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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DAX formula cumulative running total

Hi,

 

I'm trying to create a new column with the cumulative running total on the Count Case ID. I tried already a lot of things but always with incorrect results. 

BertBaeckelmans_0-1605090010220.png

 

Can anyone help me with this?

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

 

I actually just solved the problem and found where I made the mistake (table was not ranked or sorted. I created a new table with all Variant IDs and counted all Case IDs which follows a certain Variant. Next I created a RANKX to rank the table based on the count. Then I could easily create a quick measure with the running total. 

Thanks for your quick response!

Cheers

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , CountCaseID is column you can have a new column

sumx(filter(Table,[VariantID] =earlier([VariantID])),[CountCaseID])

 

if it is measure you can have only measure

sumx(filter(allselected(Table),[VariantID] =max([VariantID])),[CountCaseID])

AlB
Super User
Super User

Hi@Anonymous

I'm assuming what you show are the columns of your table placed in a visual (not aggregated) If so, you can create a calculated column in your table:

New column =
CALCULATE (
    SUM ( Table1[CountCaseID] ),
    ALL ( Table1 ),
    Table1[VariantID] <= EARLIER ( Table1[VariantID] )
)

Otherwise, you'll have to detail what it is you are showing (how the second column is built) and show a sample of the relevant tables in your model to get an accurate answer.

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Anonymous
Not applicable

Hi,

 

I actually just solved the problem and found where I made the mistake (table was not ranked or sorted. I created a new table with all Variant IDs and counted all Case IDs which follows a certain Variant. Next I created a RANKX to rank the table based on the count. Then I could easily create a quick measure with the running total. 

Thanks for your quick response!

Cheers

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors