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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Jeremy19
Helper III
Helper III

How to add columns to a table based on selection by a slicer

I'd like to be able to add numerical columns to a matrix depending on the selection of column names by a user using a slicer. I was thinking of using a field parameter but that doesn't seem to work. For exemple, I have the data :

 

idCol1Col2Col3
A1009050
B809560

 

Is it possible to have a slicer with a choice of numeric columns (Col1, Col2 or Col3) which can be used to display or not the value of these columns in a matrix with the ID in the row and the selected columns in the column ?

 

Thanks

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @Jeremy19 ,

 

Here are the steps you can follow:

1. In power query – select [Col1], [Col2], [Col3] – Transform – Unpivot Columns.

vyangliumsft_0-1697772869384.png

vyangliumsft_1-1697772869385.png

2. Placing fields into the matrix.

vyangliumsft_2-1697772888034.png

3. Result:

vyangliumsft_3-1697772888035.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Thank you for this suggestion, which works well for the example. The problem I'm having, however, is that I have a lot of columns that are created in DAX and which therefore don't appear in Power Query. Is there a solution for doing this outside Power Query?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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