Forum Discussion
Dynamic column selection for matrix visual
- 7 years ago
Hi Anonymous ,
To what I can understand you want to have an option for users to select columns that they see on the matrix table that is not an option you have on PBI by default however you can create a workaround.
Create an unrelated table with all your Columns Names that you want to have as on off on your matrix.
In my case I created a table named Selector:
Columns selection
Quantity Value Then add the following measures:
Column selection = MAX(Selector[Columns selection]) Totals Columns = SWITCH([Column selection];"Quantity";[Quantity total];"Value";[Value total])
On the second measure you should add all the related measure that you have for each column you want to show.
Now create your matrix in the following way:
Rows: Category (this are the columns that you want to have the details (keep the ones you have)
Columns: Selector[Columns Selection]
Values: [Totals Columns]
Should give the result below:
See attach PBIX.
Regards,
MFelix
Hi MFelix ,
Thanks! This works well for me. However, I'd like to add month columns on top of the columns selection (New Budget and Rolling Forecast columns). When I did that, the columns selection did not show up.
Before I added month columns
After I added month columns
Would it be possible to do multiple headers in this case? The month columns don't need to be dynamic. It would be a plus if it can be.
Thank you in advance!
Hi ttt,
When you add more than one column on a row or columns part of a matrix you get an hierarchy and you can drill down to lower levels, if you check the header of the table you have a arrow that splits into two if you click it you will go to the lowest level showing the months and the the measures.
- ttt5 years agoRegular Visitor
MFelix Thank you so much! It worked. I thought the drill down buttons were only for multiple rows.
- MFelix5 years agoSuper User
- ttt5 years agoRegular Visitor
MFelix got it. Thanks so much! One last question, I want the users to be able to sort the matrix by value in each column e.g sorting rolling forecast amounts in Dec from largest to smallest, sorting new budget amounts in Nov from smallest to largest. Is it possible to do so?
Thanks for all your help! Appreciate it.