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 nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi,
I'm fairly new to Power BI so seeing if someone can help me with my script or if the issue lies in my data.
The formula i'm trying to create and having issues with is located on the second line. If Fiscal Year doesn't equal 2020 and 2017, and Account Code equals 527990, then insert 0. Without this line, I don't have any issues, but when I insert (2020 or 2017), I get the error below.
There are no blanks in Fiscal Year, and both Data Types are consistent of Whole Numbers.
Help is appreciated!
Solved! Go to Solution.
Proud to be a Super User!
The problem is in the (2020 or 2017) part. the OR operator expects two seperate comparisons, not a summation of elements.
Try this
else if ([Fiscal Year]<>2020 or [Fiscal Year]<>2017) and .....
Kind regards
Djerro123
-------------------------------
If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.
Kudo's are welcome 🙂
Proud to be a Super User!
Thanks for the explanation and solution Djerro, it solved the error issue however I think due to my "not" <> operator and order of things, it's spitting out results i'm not looking for. I tried to just target the combination of Fiscal Year and Account Code for each year, i.e. Fiscal Year 2018 and Account Code #### then 0, but still not getting the correct results.
Will play around more and update if I find a solution.
Proud to be a Super User!
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 58 | |
| 51 | |
| 41 | |
| 30 | |
| 24 |