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

MTD calculation on the 1st of each month

I have multiple visualizations that show me case fill (ship qty/order qty) on my report. Many of them are filtered in the filter pane to show case fill for orders only in the current month, therefore creating a MTD metric visualization. I relaized today on the 1st of the month, no data was showing. Our data is refreshed in the monring to update the data that was put in yesterday. Since today is 2/1 but data is only loaded through 1/31, my MTD visualizations are empty.

 

I was trying to create a measure that would give me case fill for the last 30 days when it's the first of the month, and normal MTD case fill any other day of the month. This is what I came up with, but when I plut it inot my visuals no data is generating.

 

MTD CF =
 IF(TODAY()=STARTOFMONTH('Calendar Table'[Date]),
    CALCULATE('Case Fill Data'[Case Fill],
        DATESBETWEEN('Calendar Table'[Date], PREVIOUSDAY('Calendar Table'[Date]),TODAY()-30)),
    TOTALMTD('Case Fill Data'[Case Fill],'Calendar Table'[Date]))
1 REPLY 1
djurecicK2
Super User
Super User

Hi @Anonymous ,

 It looks like you may need to add a SUM function after Calculate. Like CALCULATE(SUM('Case Fill Data'[Case Fill]) etc..

 

CALCULATE('Case Fill Data'[Case Fill],

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