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 have created a table which holds the demographic variables used in various stacked bar charts.:
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]))
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? ![]()
Regards
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!