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!
I have a stacked column chart which holds two categories: Focus and Strategic. The values in the stacked are basicaly Yes and No for these two options.
I am trying to create a custom data label which shows 'Focus' or 'Non-Focus' for the yes and no of this category, and 'Strategic' and 'Non-Strategic' for the yes and no of this category. Because simply Yes and No sounds silly and is not informative.
So there are four options for the data label basically.
I am using a nest if statement inside a switch statement to create the data labels, but i'm getting an error that it's trying to create a true/false result when I need a text result.
Below is my syntax, if someone could help me get it working that would be super:
Data Label =
SWITCH (
IF ( SELECTEDVALUE ( 'Broker Type'[Broker Type] , "Focus" ) && SELECTEDVALUE ( 'Broker Type'[Count] , "Y" ) , "Focus" ) ,
IF ( SELECTEDVALUE ( 'Broker Type'[Broker Type] , "Focus" ) && SELECTEDVALUE ( 'Broker Type'[Count] , "N" ) , "Non-Focus" ) ,
IF ( SELECTEDVALUE ( 'Broker Type'[Broker Type] , "Strategic" ) && SELECTEDVALUE ( 'Broker Type'[Count] , "Y" ) , "Strategic" ) ,
IF ( SELECTEDVALUE ( 'Broker Type'[Broker Type] , "Strategic" ) && SELECTEDVALUE ( 'Broker Type'[Count] , "N" ) , "Non-Strategic" ) )
Evidently no-one knows how to do this! I'll try to figure it out.
Hello @JemmaD ,
can you try creating it as a calculated column with the following formula
Data Label =
SWITCH (
IF ( 'Broker Type'[Broker Type] = "Focus" && 'Broker Type'[Count] = "Y" , "Focus" ,
IF ( 'Broker Type'[Broker Type] = "Focus" && 'Broker Type'[Count] = "N" , "Non-Focus" ,
IF ( 'Broker Type'[Broker Type] = "Strategic" && 'Broker Type'[Count] = "Y" , "Strategic" ,
IF ( 'Broker Type'[Broker Type] = "Strategic" && 'Broker Type'[Count] = "N" , "Non-Strategic" ) )))
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Follow me on Linkedin
Vote for my Community Mobile App Idea 💡
Proud to be a Super User! | |
A calculated column cannot be used as a data label it needs to be a measure.
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 |
|---|---|
| 60 | |
| 54 | |
| 43 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 123 | |
| 107 | |
| 44 | |
| 32 | |
| 24 |