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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
simonandtony
Frequent Visitor

Rolling "in this month" calculation

I have an operations dashboard that displays data for the current month and year-to-date (YTD). On the current month side, all my visuals use a relative date filter to show items from "this month."

The data is updated daily, with the SQL build providing data up to the previous day (today -1).

The issue arises at the start of a new month—on the 1st, the reports appear blank because the filter is trying to include today's data, which isn't yet available.

How can I ensure that my "current month" visuals continue to display the full month's data without going blank on the first day?


PBI date error.JPG

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @simonandtony ,

 

Maybe you can try formula like below:

CurrentMonthData = 
VAR TodayDate =
    TODAY ()
VAR StartOfMonth_ =
    DATE ( YEAR ( TodayDate ), MONTH ( TodayDate ), 1 )
VAR EndOfMonth_ =
    EOMONTH ( TodayDate, 0 )
RETURN
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        'Table'[OrderDate] >= StartOfMonth_
            && 'Table'[OrderDate] <= EndOfMonth_ - 1
    )

vkongfanfmsft_0-1727854529137.png

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @simonandtony ,

 

Maybe you can try formula like below:

CurrentMonthData = 
VAR TodayDate =
    TODAY ()
VAR StartOfMonth_ =
    DATE ( YEAR ( TodayDate ), MONTH ( TodayDate ), 1 )
VAR EndOfMonth_ =
    EOMONTH ( TodayDate, 0 )
RETURN
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        'Table'[OrderDate] >= StartOfMonth_
            && 'Table'[OrderDate] <= EndOfMonth_ - 1
    )

vkongfanfmsft_0-1727854529137.png

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

dharmendars007
Super User
Super User

Hello @simonandtony , 

 

Try the below measure y replacing your measures which you have created..

 

CurrentMonthData =
IF(
DAY(TODAY()) = 1,
CALCULATE([YourMeasure], DATESINPERIOD('Date'[Date], TODAY(), -1, MONTH)),[YourMeasure])

 

If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

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.