Forum Discussion

kenmuir71's avatar
kenmuir71
Icon for Helper I rankHelper I
5 years ago
Solved

Switch between two columns in a matrix or table visual

Hi

 

I have a data set like this;

 

ProductSub ProductQty
AW9
AX6
AX10
AZ11
BU5
BV7

 

 

I want a my matrix, table visuals and various visualisations to change between columns 'Product' and 'Sub Product' by using a slicer, so outputs would be;

 

SelectedQty
A36
B

12

 

or

SelectedQty
W9
X6
X10
Z11
U5
V7

 

I know you can switch y using a measure looking at an unreletaed table for the slicer, but can't get it to work for a text column? Also I know you could switch your visuals using bookmarks, but this isn't practical given there are dozens of reports which require this functionality. Any help would be appreciated!

 

Thanks

 

Ken

 

  • Hi, kenmuir71 

    According to your description, I suggest you simply do this in Power Query editor, you can follow my steps:

    1. Go to the Power query editor, select [Qty], choose “Unpiovit other columns”:

     

    1. Sort the [Attribute] column:

     

    1. Rename columns:

    1. Apply and close, then create a Slicer and Matrix, place columns like this:

     

    And you can get what you want.

    You can download my test pbix file here

     

    Best Regards,

    Community Support Team _Robert Qin

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

4 Replies

  • Hi - thanks for your reply, I should have been more specific. A Direct Query solution is not practical, is there a solution in DAX?

    I don't want to use bookmarks as you have to change every visual/table in a large set of reports, so its not practical.

    Thanks

  • v-robertq-msft's avatar
    v-robertq-msft
    Icon for Community Support rankCommunity Support

    Hi, kenmuir71 

    According to your description, I suggest you simply do this in Power Query editor, you can follow my steps:

    1. Go to the Power query editor, select [Qty], choose “Unpiovit other columns”:

     

    1. Sort the [Attribute] column:

     

    1. Rename columns:

    1. Apply and close, then create a Slicer and Matrix, place columns like this:

     

    And you can get what you want.

    You can download my test pbix file here

     

    Best Regards,

    Community Support Team _Robert Qin

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