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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rahul49
New Member

Change table based on slicer

Hi,

I want to make my X-axis values dynamic for that i have a slicer based on which i select a table.

once i select a table from slicer i want to select column from that table. 

I tried beow 2 DAX but it did not help.

 

DAX 1
SWITCH(
SELECTEDVALUE(Customer[Customer]),
"A", VALUES(Sheet1[Category]),//LOOKUPVALUE(Sheet1[Category], Sheet1[ID], 1),
"B", VALUES(Sheet10[Category]),//LOOKUPVALUE(Sheet10[Category], Sheet10[ID], 1),
"C", VALUES(Sheet9[Category]),//LOOKUPVALUE(Sheet9[Category], Sheet9[ID], 1),
BLANK()
)
 
DAX2
 VAR SelectedTable =
     SELECTEDVALUE(Customer[Customer])
 RETURN
     IF(
         SelectedTable = "A",
         SELECTCOLUMNS(Sheet1, "Values", Sheet1[Category]),
         IF(
             SelectedTable = "B",
             SELECTCOLUMNS(Sheet2, "Values", Sheet2[Category]),
             BLANK()
         )
     )
1 REPLY 1
TomMartens
Super User
Super User

Hey @rahul49 ,

 

what is the result of the measures?

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Users online (2,744)