Forum Discussion
Switch to return column as per column slicer header selection order
Hi All,
Hope everyone is safe in this tough times.
I have a requirement,
- I would like to use switch to return column in a table
- Column headers need to present in slicer where I can return only the required columns
- Slicer selection order to be sorted out in the matrix visual
I have tried max function with switch to return the columns in a table, However max only gives us the max value in that column, it doesnt show the entire column values at all. attaching the PBIX file as well with the screenshots.
PBIX File: Link
Thanks in advance.
labuser1235 , I doubt that is possible. add remove of column is poosible using bookmarks.
Else you have do unpivot of columns and try
Dynamically change chart axis in Power BI
https://www.youtube.com/watch?v=6jeSIRpjv0M
https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/or
https://community.powerbi.com/t5/Desktop/Matrix-Display-Values-above-Columns/td-p/256905
https://community.powerbi.com/t5/Desktop/grouping-measure-results/td-p/456795
2 Replies
- amitchandak
Super User
labuser1235 , I doubt that is possible. add remove of column is poosible using bookmarks.
Else you have do unpivot of columns and try
Dynamically change chart axis in Power BI
https://www.youtube.com/watch?v=6jeSIRpjv0M
https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/or
https://community.powerbi.com/t5/Desktop/Matrix-Display-Values-above-Columns/td-p/256905
https://community.powerbi.com/t5/Desktop/grouping-measure-results/td-p/456795 - AnonymousNot applicable
Hi labuser1235 ,
According to my understand, you want to return columns based on slicer , right?
And for your first question, Measure returns a single value, so you also need a column in visual together with the measure to show the whole vaue.
For your requestment ,you need to unpivot the table after adding a column such as Index column:
Then use the following formula:
Measure = var _t=ALLSELECTED('Table (2)'[Column Name]) return CALCULATE(SELECTEDVALUE('Table1'[Value]), FILTER('Table1','Table1'[Attribute] in _t))In addition, in this case, the column sort is alphabetical order by default.
Did I answer your question ? Please mark my reply as solution. Thank you very much. 😀
Best Regards,
Eyelyn Qin