Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
How to create a running total that follow the order of my chart?
This was done in Tableau. How to replicate it in PowerBI?
Solved! Go to Solution.
Hi @Alvin2013 ,
I suggest you to try code as below to create a measure.
Running Total Sort by Values =
VAR _SUMMARIZE =
SUMMARIZE ( ALL ( 'Table' ), 'Table'[Category], "Sum", SUM ( 'Table'[Value] ) )
VAR _ADDSORT =
ADDCOLUMNS ( _SUMMARIZE, "Sort", RANKX ( _SUMMARIZE, [Sum],, DESC, SKIP ) )
VAR _RUNNINGTOTAL =
ADDCOLUMNS (
_ADDSORT,
"Running Total", SUMX ( FILTER ( _ADDSORT, [Sort] <= EARLIER ( [Sort] ) ), [Sum] )
)
RETURN
SUMX (
FILTER ( _RUNNINGTOTAL, [Category] = MAX ( 'Table'[Category] ) ),
[Running Total]
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Alvin2013 ,
I suggest you to try code as below to create a measure.
Running Total Sort by Values =
VAR _SUMMARIZE =
SUMMARIZE ( ALL ( 'Table' ), 'Table'[Category], "Sum", SUM ( 'Table'[Value] ) )
VAR _ADDSORT =
ADDCOLUMNS ( _SUMMARIZE, "Sort", RANKX ( _SUMMARIZE, [Sum],, DESC, SKIP ) )
VAR _RUNNINGTOTAL =
ADDCOLUMNS (
_ADDSORT,
"Running Total", SUMX ( FILTER ( _ADDSORT, [Sort] <= EARLIER ( [Sort] ) ), [Sum] )
)
RETURN
SUMX (
FILTER ( _RUNNINGTOTAL, [Category] = MAX ( 'Table'[Category] ) ),
[Running Total]
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Share the download link of the PBI file.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.