Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I need two measures:
1. Running total of parts (based on a due date)
2. Running total of completed parts (based on a completion date)
I need both of them in the same line graph visual.
Sample data would be:
Table: AllParts
Columns: Part Number, Status, Due Date, Completed Date
Part # Status Due Date Completed Date
123 Done 1/15/18 1/17/18
456 Done 1/30/18 1/29/18
124 Done 2/6/18 1/30/18
125 Done 2/8/18 2/7/18
001 3/15/18
500 4/1/18
I did create a date table.
I am expecting my first line of total parts to show a line that has value 2 in Jan. 4 in Feb., 5 in March, and 6 in April (thus a running total)
The second line (those done) should have value 3 for Jan., 4 in Feb. and then a straight flat line from there.
Thank you PBI Community.
Solved! Go to Solution.
Hi tlhowell36,
Create two calculate columns using DAX formula like this:
Running total of Due Date = CALCULATE(COUNTROWS(AllParts), FILTER(AllParts, MONTH(AllParts[Due Date]) = MONTH(EARLIER(AllParts[Due Date])) && YEAR(AllParts[Due Date]) = YEAR(EARLIER(AllParts[Due Date]))))
Running total of Completed Date = CALCULATE(COUNTROWS(AllParts), FILTER(AllParts, AllParts[Status] = "Done" && MONTH(AllParts[Completed Date]) = MONTH(EARLIER(AllParts[Completed Date])) && YEAR(AllParts[Completed Date]) = YEAR(EARLIER(AllParts[Completed Date]))))
PBIX here: https://www.dropbox.com/s/auq44j0nxunexh8/Running%20Count.pbix?dl=0
Regards,
Jimmy Tao
Hi tlhowell36,
Create two calculate columns using DAX formula like this:
Running total of Due Date = CALCULATE(COUNTROWS(AllParts), FILTER(AllParts, MONTH(AllParts[Due Date]) = MONTH(EARLIER(AllParts[Due Date])) && YEAR(AllParts[Due Date]) = YEAR(EARLIER(AllParts[Due Date]))))
Running total of Completed Date = CALCULATE(COUNTROWS(AllParts), FILTER(AllParts, AllParts[Status] = "Done" && MONTH(AllParts[Completed Date]) = MONTH(EARLIER(AllParts[Completed Date])) && YEAR(AllParts[Completed Date]) = YEAR(EARLIER(AllParts[Completed Date]))))
PBIX here: https://www.dropbox.com/s/auq44j0nxunexh8/Running%20Count.pbix?dl=0
Regards,
Jimmy Tao
Should be something along the lines of:
Running Total = VAR myDate = MAX('Calendar'[Date]) RETURN COUNTROWS(FILTER(ALL(Table1),[Due Date]<=myDate)) Completed Running Total = VAR myDate = MAX('Calendar'[Date]) RETURN COUNTROWS(FILTER(ALL(Table1),[Status]="Done" && [Completed Date]<=myDate))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |