Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I have a table like this.
I need to write DAX query based on this logic.
If I select 2022 as Forecast Year Filter it should show 'Forecast Previous year from 2023'. not from 2022.
If I select 2023 as Forecast Year Filter it should show 'Forecast Previous year from 2024'. not from 2023.
Exisiting DAX code is :
Appreciate if some one can support on this
Thank you.
Solved! Go to Solution.
Hi @samudralb
Please try this:
First of all, I create a set of sample data:
Then add a new table with the year column:
Table 2 = SELECTCOLUMNS('Table',"Year1",'Table'[Year])
A measure can be created:
MEASURE =
VAR _currentYear =
MAX ( 'Table 2'[Year1] )
RETURN
IF ( MAX ( 'Table'[Year] ) >= _currentYear + 1, SUM ( 'Table'[Value] ) )
Then create a slicer and a table:
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @samudralb
Please try this:
First of all, I create a set of sample data:
Then add a new table with the year column:
Table 2 = SELECTCOLUMNS('Table',"Year1",'Table'[Year])
A measure can be created:
MEASURE =
VAR _currentYear =
MAX ( 'Table 2'[Year1] )
RETURN
IF ( MAX ( 'Table'[Year] ) >= _currentYear + 1, SUM ( 'Table'[Value] ) )
Then create a slicer and a table:
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much 🙂
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
7 | |
5 | |
4 | |
3 |
User | Count |
---|---|
12 | |
11 | |
10 | |
9 | |
8 |