Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gary_connolly
Frequent Visitor

Create a Switch to dynamically chance the AXIS or LEGEND of a chart

 

I have created a table which holds the demographic variables used in various stacked bar charts.:

 

Power BI Demos.PNG

 

I was wondering if there was any way I could then use the SWITCH function to select the AXIS or Legend source, like I would for the measure:

 

X Measure = SWITCH(ALLSELECTED('Chart Measures'[Measure 1]),"Age", SELECTCOLUMNS(TransportCharge,[PatientAge]),"Ethnicity",SELECTCOLUMNS(Ethnicity,[EthnicCategory]),"Months",SELECTCOLUMNS(TransportCharge,[Transportation Month]),"Deprivation",SELECTCOLUMNS('Census Data',[Deprivation Group]))

 

 

2 REPLIES 2
v-ljerr-msft
Employee
Employee

Hi @gary_connolly,

 

Here is a similar thread in which some solutions are mentioned there. Could you go to check if it helps in your scenario? Smiley Happy

 

Regards

GilbertQ
Super User
Super User

What happens when you use your "X Measure"?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.