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

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

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.