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!View all the Fabric Data Days sessions on demand. View schedule
Hi Experts
I need a calculated column to add to the date table to show if the date including current month is in the last 24 months then 1 else 0. the relative date filter is not working on committed date, but works on date date. if that makes any sense.
Solved! Go to Solution.
Hi @blestone111 ,
I create a table as you mentioned.
Then I create a new calculated column. Here is the DAX code.
Column =
IF (
DATEDIFF ( 'Table'[Date], TODAY (), MONTH ) <= 24
&& DATEDIFF ( 'Table'[Date], TODAY (), MONTH ) >= 0,
1,
0
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @blestone111 ,
I create a table as you mentioned.
Then I create a new calculated column. Here is the DAX code.
Column =
IF (
DATEDIFF ( 'Table'[Date], TODAY (), MONTH ) <= 24
&& DATEDIFF ( 'Table'[Date], TODAY (), MONTH ) >= 0,
1,
0
)
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!