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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
eltorr0
Regular Visitor

Selecting a column based on slicer selection

I have a challenge where I'm looking to switch column values of a matrix based on a slicer selection.

tblBusiness contains two columns (competitor1 & competitor2) which I would need to choose between when selecting the slicer.

 

 

screen1.JPGscreen2.JPGscreen3.JPGThe slicer values come from tblcompetitor which lists two values. 

The output will be a matrix column selection dependent on the slicer "competitor" selection

1 ACCEPTED SOLUTION
dkay84_PowerBI
Microsoft Employee
Microsoft Employee

You can unpivot your two columns in the query editor so that you have an attribute column (competitor) and a value column (whatever was in the previous two columns).  Then you would just put the Competitor field into your slicer and the value field into your matrix.

View solution in original post

3 REPLIES 3
dkay84_PowerBI
Microsoft Employee
Microsoft Employee

You can unpivot your two columns in the query editor so that you have an attribute column (competitor) and a value column (whatever was in the previous two columns).  Then you would just put the Competitor field into your slicer and the value field into your matrix.

WHat if unpivoting was not feasible as in a scenario of 1 million rows and 1000 columns.

Or if unpivoting was not an option in power bi. How would we solve this using measures and columns

This worked flawlessly.  Can't believe it was that simple!.  Thank you!

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 Kudoed Authors