Forum Discussion

FelipeScheihing's avatar
FelipeScheihing
Frequent Visitor
3 years ago
Solved

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.

2 Replies