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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Conditionnal formating, color saturation and so on require a measure, not a column, to be able to add a touch of color to my visualization.
So I need to turn text column into measures. What is the best way to do that?
I tried the following but don't really like it
columnToMeasure =
SWITCH (
MAX([Column]);"A";1;
MAX([Column]);"B";2;
MAX([Column]);"C";3;
0
)
Solved! Go to Solution.
The error message is because in a total Row is using all the rows in the filter context.
So to avoid this message you can use IF(HASONEVALUE('Unique Won....'[PROFILE OF CANDIDATE]), SWITCH.....
Let me know if works
Thank you for clarifying the right use of the switch function 😉
Unfortunately I still end up with the following error
It does work with MAX though, but I am not a big fan of this trick ;-(
Profile ID =
SWITCH (
MAX('Unique Won SR Details'[PROFILE OF CANDIDATE]);"JR";1;"INT";2;"SR";3;0
)
The error message is because in a total Row is using all the rows in the filter context.
So to avoid this message you can use IF(HASONEVALUE('Unique Won....'[PROFILE OF CANDIDATE]), SWITCH.....
Let me know if works
Nice!
You are clearly da man!
The following works like a charm
Profile ID =
IF(HASONEVALUE('Unique Won SR Details'[PROFILE OF CANDIDATE]);SWITCH (VALUES('Unique Won SR Details'[PROFILE OF CANDIDATE]);"JR";1;"INT";2;"SR";3;0);0)
I think that will successfully create a measure but not sure if that will work in the context of a visual. I think that will depend.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!