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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Benjwill
Helper I
Helper I

date formula working inconsistently

Hi everyone, could you help me with this?

 

I created a measure to display the start date depending on the end date selected in the filter, and the period selected on my slicer (1 month, 3 months, etc). Both start date and end date are always end of month from my calendar table. 

 

My dax formula for end date:  SELECTEDVALUE(DIM_Calendar[End of Month])

 
My dax formula for start date (in this case the date 6 months before): DATEADD(DIM_Calendar[End of Month],-6,MONTH)
 

 

when the end date filter is 31 August 2024, my measure correctly displays the start date as 29 Feb 2024 (yellow highlighted): 

Benjwill_2-1730877129299.png

 

But when I selected my end date as 30 Sept 2024, my measure stopped working.  

 

Benjwill_4-1730877530436.png

 

Does any one know how I could fix it? Should I not use dateadd as the formula?

 

Thank you in advance!!!

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

Start Date = EOMONTH( [End Date], -6 )

where [End Date] is your existing end date measure.

View solution in original post

2 REPLIES 2
Benjwill
Helper I
Helper I

Hi Johnt75, this solution works! Thank you very much for your help.

johnt75
Super User
Super User

Try

Start Date = EOMONTH( [End Date], -6 )

where [End Date] is your existing end date measure.

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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