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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Prabha45
Helper III
Helper III

Date greater than formula with date hierachy

Hi All,
I have a date hierarchy filter - Year, Quarter, Month.
I need to show value [Actual] if the date selected in the filter in less than June 2023. If greater than June 2023 show [Plan].
The below works, but the data will get added going forward 2024, 2025. Can some help if there is any alternate solution for this.

Measure =
Var selectyear = Selectedvalue(Dates[Date_].[Year])
Var selectmonth = Selectedvalue(Dates[Date_].[month])
Var ans = If(selectyear =2023 && selectmonth in {"july","August","September","October","November","December"},
                   
                   [plan],[actual])
                     return ans
Thanky you.
1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Prabha45 

Please try this measure:

Measure =
Var ParameterDate = DATE( 2023 , 6 , 30 )
Var SelectedDate = MAX(Dates[Date_].[Date])
Var Result = 
    IF(
        SelectedDate <= ParameterDate,
        [actual],
        [plan]
    )
RETURN
    Result
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

1 REPLY 1
Fowmy
Super User
Super User

@Prabha45 

Please try this measure:

Measure =
Var ParameterDate = DATE( 2023 , 6 , 30 )
Var SelectedDate = MAX(Dates[Date_].[Date])
Var Result = 
    IF(
        SelectedDate <= ParameterDate,
        [actual],
        [plan]
    )
RETURN
    Result
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors