Burndown chart dax code for stories closed from total stories (Power BI) - powerbi

I have a table named "UX data", There is "issue type" field which consist of different issues in which "story" is one of the issue, "status" field which consist of different status in which "Closed" is one of them, there is "Sprint ID" field as well.
Now there are total 843 issues, out of which 288 are issue type=stories and in that 288 stories, 140 of the stories are having status=closed.
Now I need to plot burndown graph for this. There are different sprints ie sprint 1,2 etc,... there are many issues but i only want stories burnt.
Now total stories for each sprint are,
blank(no sprint id)=73 stories, sprint 1=54,sprint 2=44,sprint 3=47,sprint 4=34,sprint 5=28, sprint 6=8.
Out of this, stories that are closed for each sprint are, blank(no sprint id)=6 stories, sprint 1=33,sprint 2=26,sprint 3=24,sprint 4=25,sprint 5=20, sprint 6=6.
There are total=288 stories, out of which 140 stories are closed. Now I want to subtract total stories from stories closed each sprint. i.e 288-6(stories closed-for blank)=282 and this value should be subtracted from the next value of stories closed. ie. 282-33(story closed in sprint 1=249) and next 249 should be subtracted from stories closed in next sprint and so on.
I am not able to do it.
I tried many trial and error to subtract 288 from stories closed but then it gets subtracted from 140 instead of 288. So I tried something else. I have attached a screen shot where "SB 10" is a measure which calculates stories each sprint, "SB2" measure calculates stories closed each sprint, SB 11 is SB 10 - SB2.
I created a measure named "measure 2" which calculated total stories and gave same value to each row using all selected.
Then I thought of subtracting each row of "measure 2" should get subtracted from all the previous values of SB2 sprint values and created it using "measure 3" but here each rows of measure 2 is getting subtracted from each row of sb2 i want to subtract it from all previous values of sb2.
Example: In sprint 2, measure 2=288, this should get subtracted from SB2 from their current and previous values that is sprint 1=21, blank=67 (288-21-67=249)
These are the burndown values required:282, 249, 223,199, 174,154, 148
enter image description here

Related

How to add a user-input value to each row in a column in PowerBI

I'm new to PowerBI, so please forgive, if this is a very simple question.
I have a dataframe that holds information on patients, a timestamp for a visit at a hospital dept, which type of visit and if the amount of time between their first visit and last visit meet a certain criteria for the amount of time between the two. I created an index to be able to calculate the # of days betweeen each row's visit and the visit in the previous row. The duration is calculated based on the sum of days between visits for each single patient and the OF4-criteria is checking if the duration is above or below a certain threshold.
It looks something like this:
ID
Timestamp
Event
Index
Days_since_last_visit
Duration
OF4-criteria
01257
11-10-2021
CT-scan
0
0
79
Not met
01257
02-11-2021
PET-scan
1
22
79
Not met
01257
29-12-2021
F-code
3
47
79
Not met
5789
24-11-2021
CT-scan
4
0
29
Met
5789
7-12-2021
ECG
5
13
29
Met
and so on...
My goal is to be able to create a slider, so that I can play around with the # of days between visits and investigate, what happens with the ratio of patients that meet og don't meet the OF4-criteria.
I created a "what-if" parameter for the user to input an amount of days, that I want to subtract from the variable duration, but I can't use the input to calculate a new column, since it is a measure and only can be used in other measures.
Ideally what I want is to be able to create a new column named "what-if-duration", that is calculated with the original column "duration" and has the number of days subtracted.
Does anyone know a way to do this?

How to capture a measure result at certain date?

I have 3 measures(Measure1, Measure2 & Measure3) in my dataset. I have a "Sprint Begin" column in the dataset, what I wanted to do is calculate "Measure1" on every Sprint Begin date and capture that result. and calculate "Measure2" only after 7 days of Sprint Begin date, and calculate Measure3 only after 14 days of Sprint Begin date, each measure value should be captured for 14 days until the next Sprint Begin. I want to refresh each measure only every 14 days from the last refresh of each measure.
I want to calculate & refresh Measure1 when Max(Sprint begin)=today() only, else show the previous value( from last refresh)..Calculate and refresh measure2 when Max(Sprint begin)+7=today() only, else show the previous value( from last refresh)...calculate and refresh measure3 when Max(Sprint begin)+13=today() only, else show the previous value( from last refresh). those measures can be shown in a card visual.
Team Sprint Sprint Begin Sprint End
Team1 Sprint1 1/1/2021 1/15/2021
Team1 Sprint2 1/16/2021 1/30/2021
Team2 Sprint1 1/1/2021 1/15/2021
Team2 Sprint2 1/16/2021 1/30/2021
I was trying to store the measures in separate new tables using summarize(by Team & Sprint columns) and refresh them on those certain days manually but my source tables are big I could not even store them in separate tables because of memory issues. Any help?
you can create a master table for just storing the informations like
Sprint | Sprint Begin | spring end
this will help you to calculate in your measure by referring current date with the sprint begin and end date.

Date filtering of DAX measure in pivot chart

I have created 3 DAX measures in Power Pivot to calculate backlog value and I have an issue with filtering in pivot chart. When I filter out a specific time period, the backlog calculates only based on filtered dates. Instead of filtering, I would like to only "zoom in" to some specific time-range.
Measures
Opened:=CALCULATE(COUNTA([CreatedOn]))
Closed:=CALCULATE(COUNTA(Ticket[ClosedOn]),USERELATIONSHIP(Ticket[ClosedOn],'Calendar'[Date]))
Backlog:=CALCULATE([Opened]-[Closed],FILTER(ALLSELECTED('Calendar'),'Calendar'[Date]<=MAX('Calendar'[Date])))
Based on example data below, without filtering any dates the backlog value is following:
Date;Backlog
1/1/2021;1
2/1/2021;3
3/1/2021;1
4/1/2021;3
When I filter dates excluding 1st of January, I get following values:
Date;Backlog
2/1/2021;2
3/1/2021;1
4/1/2021;3
I want to get same values as without filtering the date. I just want to to "zoom in" on some specific date range. In my case i have 1 year of input data and want to see the backlog evolution of last 8 weeks. So when I filter last 8 weeks, my first week shows only value calculated for that week, but instead it should take into account all the values from previous periods + the result of first week
Example data
TicketNumber;Type;CreatedOn;ClosedOn;Status
ticket1;Service Request;1/1/2021;1/3/2021;Closed
ticket2;Incident Record;1/2/2021;1/3/2021;Closed
ticket3;Incident Record;1/2/2021;1/5/2021;Closed
ticket4;Service Request;1/4/2021;;Open
ticket5;Service Request;1/4/2021;;Waiting for
Fixed thanks to my colleague! :)
I had to change ALLSELECTED to ALL
Backlog:=CALCULATE([Opened]-[Closed],FILTER(ALL('Calendar'),'Calendar'[Date]<=MAX('Calendar'[Date])))

Monthly % change power bi

Hoping someone can help! Each month I receive a finance file, the total number of rows varies each month. The two columns of interest are financial_ref (which is a unique identifier for each month, though repeated across months) and outcome (which is either yes or no). A 100% stacked bar chart can show the yes/no% each month (axis = date, value = count(financial_ref), legend = outcome), but what I'd also like is a chart which can show the % difference each month. So if 'No' was 48% in March and 50% in April, I'd like a chart which shows +2% for 'no' for April, being the increase from the previous month (and likewise shows -2% for 'yes' for April). There's an additional column 'category' which stakeholders would use to filter any visualisations built. No idea where to start...

Creating and doing Market basket analysis from raw data

I have a data set with me which have many items and their sales data in terms of amount and quantity sold rolled up per week. I want to figure out that is there some correlation between the two or not, trying to access that if sales of one item affecting the other's sale or not, in terms of any positive or negative effect.
Consider the following type of data:
Week # Product # Sale($) Quantity
Week 1 Product 1 1 1
Product 2 2 1
Product 3 3 1
Week 2 Product 1 3 2
Product 3 2 1
Product 6 2 2
Week 3 Product 4 2 1
Product 3 1 2
Product 5 4 2
So,from the above data on week basis, I want to figure out that how can I convert this data into a form of market basket data with the above set of parameters available with me. Since, there isn't any market basket data available.
The parameters I could think of is :
To use the count or occurrences of each product in a given week.
To use the total quantity sold
To use the total sales to find correlation.
So, basically I have to come up with how can an item be correlated to the other of the affinity of one product with the other product.No matter it is positively correlated or negative correlated. The only issue is I do not have any primary key to bind the items with a basket or an order number since it's rolled up sales.
Any answers or help in this topic is highly appreciable. In case you find it incomplete, you can let me know for any further clarity.
You can't do this because you have no information about the co-occurrence. You also have data muddled from daily grain to weekly grain. Aggregates won't permit this.