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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Anonymous
Not applicable

Show rolling total of data till last month only

Hi All,

 

I have a DAX measure : 

Dist RT > Max running total in Month =
CALCULATE(
    [Dist RT > Max],
    FILTER(
        CALCULATETABLE(
            SUMMARIZE('Calender', 'Calender'[Date].[MonthNo], 'Calender'[Date].[Month]),
            ALLSELECTED('Calender')
        ),
        ISONORAFTER(
            'Calender'[Date].[MonthNo], MAX('Calender'[Date].[MonthNo]), DESC,
            'Calender'[Date].[Month], MAX('Calender'[Date].[Month]), DESC
        )
    )
)
 
Which Gives me a chart like this when plotted against Month.
adambal_0-1680674070588.png

How do I change the above measure to stop it at March as my data is till March. Also,

 

When I manually filter it till March, the x axis shows only3 months,

adambal_1-1680674178940.png

I need it to show all 12 months with April to December as empty.

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , with help from date table try like

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=eomonth(max('Date'[date]),-1)  ))

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=eomonth(max('Date'[date]),-1) ))

Cumm Based on Date = CALCULATE([Net], Window(1,ABS,-1,REL, ALL('date'[date]),ORDERBY('Date'[date],ASC)))

Cumm Based on Date = CALCULATE([Net], Window(1,ABS,-1,REL, ALLSELECTED('date'[date]),ORDERBY('Date'[date],ASC)))

 

 

Running Total/ Cumulative:
https://www.youtube.com/watch?v=h2wsO332LUo&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=42

 

Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors