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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Benjwill
Frequent Visitor

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
Frequent Visitor

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.