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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.