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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi there,
I am having some issues with SWITCH funtion.
I am trying to categorise NPS by score using SWITCH function -
NPS Category =
SWITCH(
TRUE(),
'Data'[NPS] >= 9, "Promoter",
'Data'[NPS] >= 7 && 'Data'[NPS] < 9, "Passive",
"Detractor"
)
But when looking for columns in 'Data' all it sees are measures.
Thank you for your help!
Solved! Go to Solution.
Hi @JulsLaw
Download PBIX file with example below
The DAX needs you to give it a single value for NPS - it shoudl have been giving you that error message?
Try this, works for me
NPS Category =
VAR _nps = SELECTEDVALUE('Data'[NPS])
RETURN
SWITCH(
TRUE(),
_nps >= 9, "Promoter",
_nps >= 7 && _nps < 9, "Passive",
"Detractor"
)
Regards
Phil
Proud to be a Super User!
Hi @JulsLaw
Download PBIX file with example below
The DAX needs you to give it a single value for NPS - it shoudl have been giving you that error message?
Try this, works for me
NPS Category =
VAR _nps = SELECTEDVALUE('Data'[NPS])
RETURN
SWITCH(
TRUE(),
_nps >= 9, "Promoter",
_nps >= 7 && _nps < 9, "Passive",
"Detractor"
)
Regards
Phil
Proud to be a Super User!
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 57 | |
| 52 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 112 | |
| 108 | |
| 39 | |
| 34 | |
| 27 |