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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.