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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello,
I am getting the below error when refreshing a report with data that includes dates from 2022.
How would I modify the formula to include 2022 with the same principle, like =IF(OR in excel?
Many thanks!
Solved! Go to Solution.
Hi @Anonymous
You could make it
IF(YEAR >= 2021, ...
then it'll work for 2023 too.
DAX does have an OR function. If you want to use that then it would be
IF(OR(YEAR = 2021, YEAR = 2022), ...
Incidentally, is Week of Year a column name? The syntax error is coming from there. You should reference a column name like this
'Table Name'[Column Name]
Hi @Anonymous
As @PaulOlding mentioned, you can use below for including 2022:
IF(YEAR >= 2021
IF(OR(YEAR = 2021, YEAR = 2022),
IFYEAR = 2021 || YEAR = 2022,
and the error is for that Week of Year, if that is the column name and you want to create measure, you need to use it in [ ] with an aggregation formula, like MAX(table[Week of Year]), otherwise, if that is a measure, you need to use it in [ ] lke this [Week of Year], but if you want to create a calculated column you can just use the table[Week of Year] in your formula.
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hi @Anonymous
You could make it
IF(YEAR >= 2021, ...
then it'll work for 2023 too.
DAX does have an OR function. If you want to use that then it would be
IF(OR(YEAR = 2021, YEAR = 2022), ...
Incidentally, is Week of Year a column name? The syntax error is coming from there. You should reference a column name like this
'Table Name'[Column Name]
User | Count |
---|---|
14 | |
10 | |
7 | |
6 | |
5 |
User | Count |
---|---|
30 | |
19 | |
12 | |
7 | |
5 |