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
RajK2
Helper V
Helper V

DAX Help cumulative calculation

Hello - I am trying to calculate cumulative calculation, X axis = Description, Y Axis = Amount$M, Line y-axis = Cumulative %

its working fine if i select single Quarter in the Filter (callendar table) incase select multiple quarter its not working, how to sort it out.  I changed to VAR _period = VALUES('Calendar'[Quarter]) not works, suggest

Amount $M =

VAR _period = SELECTEDVALUE('Calendar'[Quarter])

RETURN
CALCULATE(SUM('Table'[Value])/1000000,
'Table'[Quarter] = _period)

 

Cumulative % =

(DIVIDE([ParetoCumulativeOrders],CALCULATE(
'Table'[Amount $M],
ALLSELECTED('Table')
)))*100


ParetoCumulativeOrders =

VAR CurrentRank = [ParetoRank]
RETURN
CALCULATE (
'Table'[Amount $M],
FILTER (
ALLSELECTED ( 'Table'[Description] ),
[ParetoRank] <= CurrentRank
)
)

ParetoRank = RANKX(
ALLSELECTED('Table'[Description]),
'Table'[Amount $M],
,
DESC,
Dense
)

 

1 ACCEPTED SOLUTION
vojtechsima
Super User
Super User

hey, @RajK2 
SELECTEDVALUE will return blank if there is more than value in current context. So you can only select single qurater if you wanna do it this way.

If I were you, I would build the cumulative sum differently:

vojtechsima_0-1761298237452.png

 



cumulative = 
CALCULATE(
    [Amount $M],
    'fact'[Quarter] <= MAX('fact'[Quarter])
)

 

View solution in original post

3 REPLIES 3
v-priyankata
Community Support
Community Support

Hi @RajK2 

Thank you for reaching out to the Microsoft Fabric Forum Community.

@vojtechsima Thanks for the inputs.

I hope the information provided by user was helpful. If you still have questions, please don't hesitate to reach out to the community.

 

Hi @RajK2 

Hope everything’s going smoothly on your end. I wanted to check if the issue got sorted. if you have any other issues please reach community.

vojtechsima
Super User
Super User

hey, @RajK2 
SELECTEDVALUE will return blank if there is more than value in current context. So you can only select single qurater if you wanna do it this way.

If I were you, I would build the cumulative sum differently:

vojtechsima_0-1761298237452.png

 



cumulative = 
CALCULATE(
    [Amount $M],
    'fact'[Quarter] <= MAX('fact'[Quarter])
)

 

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.