cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
talk2mkn
Regular Visitor

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 @talk2mkn ,

 

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 @talk2mkn ,

 

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

amitchandak
Super User IV
Super User IV

@talk2mkn , 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/3...

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

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 

 

@talk2mkn , 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

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.