Forum Discussion
Custom slicer to select and display multiple columns
- Anonymous2 years ago
Hi Anonymous ,
I updated my pbix file(see the attachment), please find the details in it.
The below one is my answer of your above questions:
1. It has been achieved in my updated pbix file.
2 and 3: I'm sorry those two things can't be accomplished. Regarding your third question, you can add the latest year to the YEAR table to avoid that the latest year's data can't be rendered in table visual.
Using unpivot+matrix is the best solution to solve your three problems. (Years are multi-selected, unselected years are not shown in the visual, slicer options are from this table)
Best Regards
Hi Anonymous,
Thank you so much for your response. This is working great!
However, I have encountered 1 problem and 2 follow-up questions.
- The visual works perfect when I select a single year in the slicer, but it would not work when I multi-select. It could not display ALL years as well. For my data, I have 4 years that I would like to either display 1, multiple, or all years. Could you kindly help on this topic?
- Currently, when I select 2020 in the Year slicer, columns 2021 A, B, and C would be blank but still displayed. Is it possible to hide and not display the columns that weren't selected in the Year slicer?
- The table visual you created has columns aa, bb, cc... selected from "Table 2", and 2020A, 2020B, 2020C... selected from the "Year" table. Because I plan to refresh the Power BI dashboard weekly with new data pasted to the same excel file, is it possible to select 2020A, 2020B, 2020C... from "Table 2" instead of "Year"? How can I modify the current code for the slicer to still work?
Thank you. Really appreciate your help!
Hi Anonymous ,
I updated my pbix file(see the attachment), please find the details in it.
The below one is my answer of your above questions:
1. It has been achieved in my updated pbix file.
2 and 3: I'm sorry those two things can't be accomplished. Regarding your third question, you can add the latest year to the YEAR table to avoid that the latest year's data can't be rendered in table visual.
Using unpivot+matrix is the best solution to solve your three problems. (Years are multi-selected, unselected years are not shown in the visual, slicer options are from this table)
Best Regards
- Anonymous2 years agoNot applicable
Hello Anonymous,
Yes, this is looking great! Thank you so much for all the responses. Really appreciate it!