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

Month Slicer not working for Running Total

I am trying to calculate the running total of a set of measures by months in my matrix. The running total is working by itself, however when used with my monthly slicer it breaks. I want it to calculate up to the month selected in the slicer, but instead it filters for that specific month.

example: when I select May I want to see running total froo every month from Jan to May but it shows me data only in the month of May.
Running Total = CALCULATE
                             ( SUM ( Table[column] ),
                                FILTER ( ALLSELECTED( Table ),
                                  Table[columnDate] <= MAX ( Table[ColumnDate] ) ) )

The Month Slicer comes from Table[ColumnDate].Month

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Here's my approach:

  1. Create a Calendar Table and write calculated column formulas to extract Year, Month Name and Month Number.  Using the Month number column, use the "Sort By" column feature to ensure that the Month Names are sorted
  2. Create a relationship from the ColumnDate field of the Table to the Date column of the Calendar Table
  3. Create 2 slicers - one each for Month Name and Year.  Select 2020 and May in those slicers
  4. Write these measures

Total = SUM(Table[Column])

Total YTD = CALCULATE([Total],DATESYTD(Calendar[Date],"31/12"))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

Perhaps:

Running Total = CALCULATE
                             ( SUM ( Table[column] ),
                                FILTER ( ALLEXCEPT( Table[ColumnDate ),
                                  Table[columnDate] <= MAX ( Table[ColumnDate] ) ) )


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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