Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hi,
I have below if function where CY is equals to 12/31/2021 it should return Last Year. However formula returns 0. Anyone can help with what's causing this error?
Solved! Go to Solution.
Hi @dokat ,
Try the calculated column
Column = IF([CY]=DATE(2021,12,31),"Last Year","0")
Calculated columns and measures are different, please note.
What is the difference between Power BI calculated columns and measures? - TrueCue.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @dokat
Can you try:
Measure = IF ( Table[Column] = DATE ( 2021, 12, 31 ) , 1 , 0 )
Hope it helps.
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
@TheoC Unfortunately it didnt work. And i'd like to make the lookup value to be dynamic rather than hard coded as it will change over time. '
Where formula equals to = 'Tier'{CY] (12/31/2021) Thanks
@dokat can you show me the screenshot of the error?
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Hi @dokat ,
Try the calculated column
Column = IF([CY]=DATE(2021,12,31),"Last Year","0")
Calculated columns and measures are different, please note.
What is the difference between Power BI calculated columns and measures? - TrueCue.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 23 | |
| 19 | |
| 18 | |
| 17 | |
| 13 |
| User | Count |
|---|---|
| 61 | |
| 53 | |
| 47 | |
| 40 | |
| 38 |