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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Running Total with simple value with/without filters

Hi All,

 

I have trying to calculated running Total (Count of Records) using quick measure and RankX but unable to achive my view. Please refer attached power BI file.  I want use DAX as I need to use this data with other tables for my trends.

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can use the following measure instead of use rankx:

Measure = CALCULATE(COUNT(Sheet1[Species]),FILTER(ALLEXCEPT(Sheet1,Sheet1[Species]),Sheet1[Date]<=MAX(Sheet1[Date])))

2.gif

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

View solution in original post

4 REPLIES 4
v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can use the following measure instead of use rankx:

Measure = CALCULATE(COUNT(Sheet1[Species]),FILTER(ALLEXCEPT(Sheet1,Sheet1[Species]),Sheet1[Date]<=MAX(Sheet1[Date])))

2.gif

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

 

amitchandak
Super User
Super User

@Anonymous , there is no file link

Example of running total

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(Sales),Sales[Sales Date] <=max(Sales[Sales Date])))

 

Rank

Geography Rank = RANKX(all(Geography[City]),[Sales])
Geography Rank = RANKX(all(Geography),[Sales])
City and ID Rank = RANKX(all(Geography[City],Geography[City Id]),[Sales])

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/367415

 

Anonymous
Not applicable

Hi Amit,

 

But I have filter on Species Column but not on Date. When I apply Filters Its working as expected but when I select ALL in Filters its gving me wrong values.

 

My Data Contains - Date, Species, Test(Index) Columns.

 

Please find my files here 

 

@Anonymous , I created a measure like this, and seem to be working, One you had was a column

 

Measure = CALCULATE(COUNT(Sheet1[Species]), FILTER(ALLSELECTED(Sheet1), Sheet1[Date]<=max(Sheet1[Date])))

 

File is attached after signature

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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