Forum Discussion
Create Slicer for Multiple Columns
- 3 years ago
If anyone can find a way to resolve this so that the traditional slicer works with multiple calculated columns it would be appreciated. In the meanwhile i found another visualization as a work around. not as good a the traditional slicer but it does seem to work for now. It is the selection slicer by Walnut Innovation.
Hi ss8551 ,
I created a sample pbix file(see the attachment), please check if that is what you want.
1. Unpivot these course columns in Power Query Editor as below screenshot
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("hZA7D4MwDIT/CsrMECd2HmPHbt0RA4VAeQUJIfXvVxQJaHlJt/nu89lRxJKnkMhCNokkCq1E8OiTdChTNw8WxWHE0gxJjXatUHMb3P3Qd2sXWUEAPLilte/ejcsK1zo/bEAuV9qcgWYpBSgF7RCV1oAGl84jOC8sh13QanvxAiF/lhgAS7hfY0yU1XT4fznDrSSzzh33/YKqWht7VO4i27QcxNVtrZdIJ6bt1+IP", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Rep = _t, #"5764709 Intro" = _t, #"5999904 Acknowledgement" = _t, #"5342762 Practice" = _t, #"6811954 Intro" = _t, #"5925110 Acknowledgement" = _t, #"6809358 Intro" = _t, #"5395326 Intro" = _t, #"6614325 Acknowledgement" = _t, #"6771484 Practice" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Rep", type text}, {"5764709 Intro", type text}, {"5999904 Acknowledgement", type text}, {"5342762 Practice", type text}, {"6811954 Intro", type text}, {"5925110 Acknowledgement", type text}, {"6809358 Intro", type text}, {"5395326 Intro", type text}, {"6614325 Acknowledgement", type text}, {"6771484 Practice", type text}}),
#"Unpivoted Only Selected Columns" = Table.Unpivot(#"Changed Type", {"5764709 Intro", "5999904 Acknowledgement", "5342762 Practice", "6811954 Intro", "5925110 Acknowledgement", "6809358 Intro", "5395326 Intro", "6614325 Acknowledgement", "6771484 Practice"}, "Course", "IsTake"),
#"Filtered Rows" = Table.SelectRows(#"Unpivoted Only Selected Columns", each ([IsTake] <> ""))
in
#"Filtered Rows"
2. Create a slicer using the field [Course] and a table visual as below screenshot
If the above one can't help you get the expected result, could you please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards