Hello Power BI community,
I'm working on a maintenance dashboard and have an issue with a running total. I have calculated measures for tool supply and tool demand. The minimum of these 2 measures is the number of tools we will build in the given month. The tools are prioritized, and I want to calculate a running total of the minimum column to give us an idea of when we will run out of materials.
Priority | Tool | Supply | Demand | Minimum |
1 | Tool A | 97 | 112 | 97 |
2 | Tool B | 56 | 8 | 8 |
3 | Tool C | 44 | 0 | 0 |
4 | Tool D | 14 | 13 | 13 |
5 | Tool E | 20 | 11 | 11 |
6 | Tool F | 16 | 2 | 2 |
My equation looks like this:
Running Total = CALCULATE( MIN( [Supply] , [Demand] ) , FILTER( ALL( Asset_Mapping ), Asset_Mapping[ID] <= MAX( Asset_Mapping[ID] ) ) )
Measure | Measure | Result | Expected Result | |||
Priority | Tool | Supply | Demand | Minimum | Running Total | Running Total |
1 | Tool A | 97 | 112 | 97 | 97 | 97 |
2 | Tool B | 56 | 8 | 8 | 120 | 105 |
3 | Tool C | 44 | 0 | 0 | 120 | 105 |
4 | Tool D | 14 | 13 | 13 | 133 | 118 |
5 | Tool E | 20 | 11 | 11 | 144 | 129 |
6 | Tool F | 16 | 2 | 2 | 146 | 131 |
You can see that I don't get the result I expected. It seems to calculate the minimum of the running total and I would like to calculate the running total of the minimum. Any help is greatly appreciated. Thanks in advance.
Cheers,
Linds
Solved! Go to Solution.
Hi @LindsW8
I don’t have dataset with column Asset_Mapping[ID] as you used, so I use column [Priority] in your provided table instead. Anyway it works out your expected result.
Try formula below to calculate running total of minimum of two expressions
Measure 3 = CALCULATE ( SUMX ( Sheet2, MIN ( [Supply], [Demand] ) ), FILTER ( ALL ( Sheet2 ), Sheet2[Priority] <= MAX ( Sheet2[Priority] ) ) )
Best Regards
Maggie
Hi @LindsW8
I don’t have dataset with column Asset_Mapping[ID] as you used, so I use column [Priority] in your provided table instead. Anyway it works out your expected result.
Try formula below to calculate running total of minimum of two expressions
Measure 3 = CALCULATE ( SUMX ( Sheet2, MIN ( [Supply], [Demand] ) ), FILTER ( ALL ( Sheet2 ), Sheet2[Priority] <= MAX ( Sheet2[Priority] ) ) )
Best Regards
Maggie
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
465 | |
205 | |
116 | |
58 | |
53 |
User | Count |
---|---|
485 | |
249 | |
140 | |
77 | |
71 |