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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
FelipeScheihing
Frequent Visitor

Time Intelligence using Measure which returns a Date

Dear all, 

I created a measure that returns a date (Waiting Period Ends); I need to generate another measure that returns the start of the following month respecting Waiting Period Ends.

 

Waiting Period Ends =
if([Hours Month (-4)]>129.999,[Comparison_MaxDate_StartOftMonth(-4)]+59,
        if([Hours Month (-3)]>129.999,[Comparison_MaxDate_StartOftMonth(-3)]+59,
            if([Hours Month (-2)]>129.999,[Comparison_MaxDate_StartOftMonth(-2)]+59,
                if([Hours Month (-1)]>129.999,[Comparison_MaxDate_StartOftMonth(-1)]+59,
                    if([Hours Current Month]>129.999,[Comparison_MaxDate_StartOfCurrentMonth]+59
                )))))
 
I tried to use time intelligence DAX expressions like STARTOFMONTH, and DATEADD, but i failed 
 
 
For example,
if Waiting Period Ends returns 12/14/2022
the new measure should return: 1/1/2023 (first day of the next month)
 
Thank you, I appreciate your time.
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@FelipeScheihing Try:

Measure = 
  VAR __EOM = EOMONTH([Waiting Period Ends],1)
  VAR __Result = DATE(YEAR(__EOM), MONTH(__EOM), 1)
RETURN
  __Result

Also, time intelligence functions are evil. You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@FelipeScheihing Try:

Measure = 
  VAR __EOM = EOMONTH([Waiting Period Ends],1)
  VAR __Result = DATE(YEAR(__EOM), MONTH(__EOM), 1)
RETURN
  __Result

Also, time intelligence functions are evil. You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler, thank you so much! it worked perfectly! I will check the material you shared. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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