Forum Discussion
How to filter which columns are shown
Hello PBI-Community,
i have a table that looks something like this:
| Region | Cost | Calculated_Col1 | Calculated_Col2 |
| Europe | 100 | x | x |
| Asia | 200 | x | x |
What I want to implement is a slicer with the two elements "Calculated_Col1" and "Calculated_Col2" in it and the table above should only show the columns Region, Cost and the in the slicer selected column(s). Couldn“t figure out how to do it yet..
Thanks for the help
Jakob
- Anonymous5 years ago
Hi Anonymous ,
1.Create a seperate table like
2.Create the following measure
Filtered result = SWITCH(SELECTEDVALUE('Table (2)'[Slicer]),"Calculated_Col1",[Calculated_Col1],"Calculated_Col2",[Calculated_Col2])3.The results are as follows. When you filter in the slicer, the results of the filter find changes.
You can check more details from the attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- AnonymousNot applicable
Hi Anonymous ,
1.Create a seperate table like
2.Create the following measure
Filtered result = SWITCH(SELECTEDVALUE('Table (2)'[Slicer]),"Calculated_Col1",[Calculated_Col1],"Calculated_Col2",[Calculated_Col2])3.The results are as follows. When you filter in the slicer, the results of the filter find changes.
You can check more details from the attachment.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- amitchandak
Super User
Anonymous , if Calculated columns Calculated_Col1 and Calculated_Col2 are aggregatable then Measure slicer other wise one the three option bookmark, Unpivot or direct Query M parameters
measure slicer
https://www.youtube.com/watch?v=b9352Vxuj-M
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115If they can not be measures
Dynamically change chart axis in Power BI
bookmark -https://blog.crossjoin.co.uk/2018/04/20/dynamically-changing-a-chart-axis-in-power-bi-using-bookmarks-and-buttons/
https://www.youtube.com/watch?v=6jeSIRpjv0M
https://datamonkeysite.com/2020/10/22/change-dimension-dynamically-using-parameter-in-powerbi/