Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Running total of Pre-Summed Data

Hi all, I'm attempting to make a pareto chart but am having issues computing a running total. The data needs to be groups first by the Reason3_Desc column and summed within each column. However, when I try to run a RANKX command, it generates a weird output since I believe it is calculating the rank within each Reason3_Desc category instead of as a whole. Any help would be great! Thanks!

 

Source Code is included at the bottom of the post

 

For reference, here are the measures I currently am using and their outputs: 

 

TotalDT = SUM([Downtime])

Rank = RANKX(ALLSELECTED(RawDowntimeEventData),[TotalDT])

RunningTotalDT = CALCULATE([TotalDT], TOPN([Rank],ALLSELECTED(RawDowntimeEventData),[TotalDT]))

 

 

 

 

 

 

As well as the output:

jzajakala_0-1720794231337.png

The expected output should be along the lines of 

Reason3_DescDowntimeRankRunning Total
Clinker Cooler Drive Malf310.231310.23
Kiln System Preheat237.372547.60
Clinker Ring / Ball Removal68.973616.57

 

 

 

 

Source Code

StartTimeEndTimeReason3_DescDowntime
7/10/2024 9:057/10/2024 9:11Kiln Feed Pump Malf0.1
7/3/2024 0:047/3/2024 2:29 2.416666667
7/2/2024 19:047/2/2024 19:13 0.15
7/2/2024 1:107/2/2024 1:21 0.183333333
7/1/2024 6:157/1/2024 6:33 0.3
6/30/2024 12:516/30/2024 12:57 0.1
6/29/2024 20:176/29/2024 20:27 0.166666667
6/27/2024 2:536/27/2024 2:59 0.1
6/25/2024 16:076/26/2024 20:36Traveling Grate28.48333333
6/23/2024 17:056/23/2024 19:15 2.166666667
6/18/2024 15:096/18/2024 15:16 0.116666667
6/17/2024 23:366/17/2024 23:41 0.083333333
6/13/2024 14:456/13/2024 14:50 0.083333333
6/13/2024 11:336/13/2024 12:25Traveling Grate0.866666667
6/12/2024 20:056/12/2024 21:46Traveling Grate1.683333333
6/12/2024 17:166/12/2024 19:43Kiln System Preheat2.45
6/12/2024 7:206/12/2024 16:56Clinker Ring/Ball Removal9.6
6/2/2024 18:276/2/2024 18:38Kiln ID Fan Malf0.183333333
5/25/2024 17:185/25/2024 17:26Kiln System Preheat0.133333333
5/24/2024 1:165/24/2024 5:18Internal Power Malfunction4.033333333
5/21/2024 12:135/22/2024 8:48 20.58333333
5/20/2024 17:225/20/2024 17:49Kiln ID Fan Malf0.45
5/17/2024 10:035/17/2024 15:36Pellitizer Pan System5.55
5/14/2024 9:355/14/2024 9:43Pellitizer Pan System0.133333333
5/12/2024 17:075/12/2024 19:16Kiln Feed Conveying, Elevator Malf2.15
5/8/2024 20:585/8/2024 23:24Clinker Cooler Overload2.433333333
4/17/2024 1:224/17/2024 1:25Pellitizer Pan System0.05
4/14/2024 18:024/14/2024 21:43K F System Malfunction3.683333333
4/14/2024 12:534/14/2024 12:57Pellitizer Pan System0.066666667
4/9/2024 6:374/11/2024 19:14Kiln System Preheat60.61666667
4/8/2024 23:284/8/2024 23:37Kiln System Flush0.15
4/7/2024 17:024/7/2024 17:28Pellitizer Pan System0.433333333
4/5/2024 12:094/7/2024 16:54Kiln System Preheat52.75
4/3/2024 23:164/4/2024 15:50 16.56666667
4/3/2024 7:264/3/2024 7:30Kiln Feed Pump Malf0.066666667
3/30/2024 6:513/30/2024 13:37Blend Silo Repairs6.766666667
3/29/2024 13:293/30/2024 4:52Blend Silo Repairs15.38333333
3/29/2024 12:303/29/2024 12:33Unknown0.05
3/21/2024 5:593/23/2024 17:21Clinker Ring/Ball Removal59.36666667
3/14/2024 11:013/14/2024 13:06Traveling Grate2.083333333
3/10/2024 7:283/10/2024 14:18Pellitizer Pan System6.833333333
3/8/2024 2:313/8/2024 3:06Pellitizer Pan System0.583333333
3/6/2024 3:593/6/2024 23:02Unknown19.05
2/20/2024 17:252/25/2024 18:50Kiln System Preheat121.4166667
2/19/2024 20:352/19/2024 21:07Traveling Grate0.533333333
2/6/2024 6:212/6/2024 17:04Unknown10.71666667
2/4/2024 10:362/4/2024 19:48CEMS / Analyzer Malfunction9.2
1/30/2024 6:162/1/2024 22:06Clinker Cooler, general Malf63.83333333
1/15/2024 1:571/28/2024 0:11Clinker Cooler Drive Malf310.2333333
1/14/2024 17:361/14/2024 17:42 0.1
1/5/2024 9:111/5/2024 9:35Pellitizer Pan System0.4
1/4/2024 8:491/4/2024 18:38Kiln Feed Pump Malf9.816666667
1/3/2024 22:341/4/2024 8:45Kiln Feed Pump Malf10.18333333
1/3/2024 18:261/3/2024 20:47Traveling Grate2.35

 

1 ACCEPTED SOLUTION
Irwan
Super User
Super User

hello @Anonymous 

 

looks like your rank is affected not only by sum of downtime.

 

try modifiying your rank DAX: 

Rank = RANKX(ALLSELECTED('Table'[Reason3_Desc]),[TotalDT],,DESC)
 
change value inside ALLSELECTED into your 'Reason3_Desc'
Rank = RANKX(ALLSELECTED(RawDowntimeEventData),[TotalDT])

 

And let see if this will fix your rank measure.

Irwan_5-1720833594742.png


Hope this will help you.

Thank you.

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Based on the table that you have showed, clearly show the expected result.  Also, what do blanks in the Reason3_Desc mean?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Irwan
Super User
Super User

hello @Anonymous 

 

looks like your rank is affected not only by sum of downtime.

 

try modifiying your rank DAX: 

Rank = RANKX(ALLSELECTED('Table'[Reason3_Desc]),[TotalDT],,DESC)
 
change value inside ALLSELECTED into your 'Reason3_Desc'
Rank = RANKX(ALLSELECTED(RawDowntimeEventData),[TotalDT])

 

And let see if this will fix your rank measure.

Irwan_5-1720833594742.png


Hope this will help you.

Thank you.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.