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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I'm a new Power BI user and used to SQL and excel.
I tried this in DAX as a nested if statement, but gave me an error.
StandardResult = if(Standards[Score]>Standards[Year Level],"Above",if(Standards[Score]<Standards[Year Level],"Below","At Standard"))
Thanks for any help,
Q
Solved! Go to Solution.
The code you wrote should work in a calculated column on the Standards table, but if you are creating a measure then you would need to use SELECTEDVALUE, like
StandardResult =
IF (
SELECTEDVALUE ( Standards[Score] ) > SELECTEDVALUE ( Standards[Year Level] ),
"Above",
IF (
SELECTEDVALUE ( Standards[Score] ) < SELECTEDVALUE ( Standards[Year Level] ),
"Below",
"At Standard"
)
)
The code you wrote should work in a calculated column on the Standards table, but if you are creating a measure then you would need to use SELECTEDVALUE, like
StandardResult =
IF (
SELECTEDVALUE ( Standards[Score] ) > SELECTEDVALUE ( Standards[Year Level] ),
"Above",
IF (
SELECTEDVALUE ( Standards[Score] ) < SELECTEDVALUE ( Standards[Year Level] ),
"Below",
"At Standard"
)
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 28 | |
| 19 | |
| 11 | |
| 10 |