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
theo
Helper III
Helper III

measure

i would like to know how to call out another measure to use in another measure.

i have created below:

count_product = SUMX(all('table'[column1]),calculate(COUNT('table'[Column1])))

and

cumulative sum= SUMX(FILTER(ALL([count_product]),[count_product]<=max([count_product])),[count_product])

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

Hope this helps! Smiley Happy

 

New Table =
SUMMARIZE (
    'Table',
    'Table'[Type],
    "Count of Type", COUNTROWS ( 'Table' ),
    "Type Rank by Count", RANKX ( ALL ( 'Table'[Type] ), CALCULATE ( COUNTROWS ( 'Table' ) ) )
)

Cumulative Sum Column =
CALCULATE (
    SUM ( 'New Table'[Count of Type] ),
    FILTER (
        'New Table',
        'New Table'[Type Rank by Count] <= EARLIER ( 'New Table'[Type Rank by Count] )
    )
)

New Table - Rank and RT.png

 

Continued here...

http://community.powerbi.com/t5/Desktop/cumulative-sum/m-p/136762/highlight/false#M58688

View solution in original post

13 REPLIES 13
Greg_Deckler
Community Champion
Community Champion

You probably need to do a SUMMARIZE where you essentially dynamically create a table that effectively has rows in which that measure is evaluated and feed that to your FILTER as the table. Only so much I can do without seeing some sample data but your situation seems similar to one I ran into here:

 

https://community.powerbi.com/t5/Desktop/Data-Modeling-Issue-Fun/m-p/125007#M52919



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Here is the visual of my data.  the last column is the one that i am trying to create.

i tried the summarize but then there is an error that says about max when i used the column defined in the summarize

 

Type

count_product

Cumulative sum
1500500
3330830
22201050
Sean
Community Champion
Community Champion

Hope this helps! Smiley Happy

 

New Table =
SUMMARIZE (
    'Table',
    'Table'[Type],
    "Count of Type", COUNTROWS ( 'Table' ),
    "Type Rank by Count", RANKX ( ALL ( 'Table'[Type] ), CALCULATE ( COUNTROWS ( 'Table' ) ) )
)

Cumulative Sum Column =
CALCULATE (
    SUM ( 'New Table'[Count of Type] ),
    FILTER (
        'New Table',
        'New Table'[Type Rank by Count] <= EARLIER ( 'New Table'[Type Rank by Count] )
    )
)

New Table - Rank and RT.png

 

Continued here...

http://community.powerbi.com/t5/Desktop/cumulative-sum/m-p/136762/highlight/false#M58688

Hi Sean, i tried this but it says that the DAZ has error.

Hi @theo,

 

What is the error?  Do your Table and Column names match the formula posted by @Sean ?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Sean
Community Champion
Community Champion

Post the formula you are using


@Sean wrote:

Post the formula you are using


here is what i have. i just copied your code

 

Capture.PNG

Hi @theo,

 

I see the issue.  Seans instructions are 2 steps that need to be done separately.

 

First create a table like this 

 

New Table =
SUMMARIZE (
    'Table',
    'Table'[Type],
    "Count of Type", COUNTROWS ( 'Table' ),
    "Type Rank by Count", RANKX ( ALL ( 'Table'[Type] ), CALCULATE ( COUNTROWS ( 'Table' ) ) )
)

and then once you have the table, create a column on that table like this

 

Cumulative Sum Column =
CALCULATE (
    SUM ( 'New Table'[Count of Type] ),
    FILTER (
        'New Table',
        'New Table'[Type Rank by Count] <= EARLIER ( 'New Table'[Type Rank by Count] )
    )
)

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

thanks, i tried but i have different result from what is expected.  the rank is 1 for all, see below:

Capture.PNGCapture1.PNG

 

in addition, i realized the result will be fixed bu i need something that could change at a later stage.  i have another column for the product code, then new ones will be added later.  i will then need the cumulative sum based on the new column (product code) and not the type.  thank you so much for providing time to help.

@Sean and @Phil_Seamark

thanks, i tried but i have different result from what is expected.  the rank is 1 for all, see below:

Capture.PNGCapture1.PNG

 

in addition, i realized the result will be fixed bu i need something that could change at a later stage.  i have another column for the product code, then new ones will be added later.  i will then need the cumulative sum based on the new column (product code) and not the type.  thank you so much for providing time to help.

@Phil_Seamark @Sean

i think i found an issue.  the products column is actually text, i have then created another column where i put 1 in every row and the rank fomula was corrected.

 

tahnks for all hte help.

Nice work @theo


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!


Sean wrote:

Post the formula you are using


Here is the error.  the first one i think is ok, but hte next call out has an error.

Capture.PNG

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.