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

Cumulative Total on a Calculated Measure where data is not null With in a specific Data range

 

Hi Gurus,
Need a help on below,

I ned to caluculate Cumulative Total on a Calculated Measure per each Category and Country wher the data is not null With in a specific Data range

In the below example 
my Current DAX is here 

C Total=
CALCULATE (
DISTINCTCOUNT('Table'[ID] ),
FILTER (
'Table',
AND( 'Table[IsAccountActive] <> "False", 'TAble'[Flag]="True")),'Table'[opted]>0,'Table'[ID]<>BLANK()
)
 
I need this formula to be Cummlative total eg: in below screen shot ,
Expected result :
For USA and SAles with in Column E ,
Row 10 should be 18,
Row 11 should be 33,
row 12 should be blank as it does not have a value 
should folow same for remaining
Dimpu_1-1618142260006.png

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Please try this measure:

Measure 2 = CALCULATE(SUMX(FILTER('Table',COUNTROWS(FILTER('Table','Table'[Category]=EARLIER('Table'[Category])&&'Table'[Country]=EARLIER('Table'[Country])&&'Table'[Date]>=EARLIER('Table'[Date])))),[Measure]))


If the problem persists,could you share the sample pbix with dummy data?

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-... 

View solution in original post

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Please try this measure:

Measure 2 = CALCULATE(SUMX(FILTER('Table',COUNTROWS(FILTER('Table','Table'[Category]=EARLIER('Table'[Category])&&'Table'[Country]=EARLIER('Table'[Country])&&'Table'[Date]>=EARLIER('Table'[Date])))),[Measure]))


If the problem persists,could you share the sample pbix with dummy data?

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-... 

Anonymous
Not applicable

Thanks for the reply, this is working now

Vera_33
Resident Rockstar
Resident Rockstar

Hi @Anonymous 

 

Is the screenshot showing the result of current measure? Can you provide some sample data in a format we can copy?

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.