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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
ERing
Post Partisan
Post Partisan

Need measure for MTD up to Prior Day

I have a requirement to show [Total_Sales] for the current month up to the Prior Day. My report will not have a date slicer or any Date context in the visuals.

 

For example, today is May 12th, 2025. I need the measure to show [Total_Sales] from May 1st, 2025 - May 11, 2025. When we reach May 18th, 2025, the measure should show [Total_Sales] between May 1st, 2025 - May 17th, 2025.

1 ACCEPTED SOLUTION
techies
Solution Sage
Solution Sage

Hi @ERing As i understand, MTD value up to yesterday, please check this measure

 

MTD Total Sales - Up to Prior Day =
VAR TodayDate = TODAY()
VAR Monthstart = DATE(YEAR(TodayDate), MONTH(TodayDate), 1)
VAR EndDate = TodayDate - 1

RETURN
CALCULATE(
    SUM('cases'[Value]),
    DATESBETWEEN(
        'Date'[Date],
        Monthstart,
        EndDate
    )
)
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

View solution in original post

3 REPLIES 3
techies
Solution Sage
Solution Sage

Hi @ERing As i understand, MTD value up to yesterday, please check this measure

 

MTD Total Sales - Up to Prior Day =
VAR TodayDate = TODAY()
VAR Monthstart = DATE(YEAR(TodayDate), MONTH(TodayDate), 1)
VAR EndDate = TodayDate - 1

RETURN
CALCULATE(
    SUM('cases'[Value]),
    DATESBETWEEN(
        'Date'[Date],
        Monthstart,
        EndDate
    )
)
― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

@techies 

Yes, this appears to be working.  And just to confirm, this will adjust with new months into the future, correct? For example, when we reach June 2, this will provide data for June 1?

yes

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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