Forum Discussion
Dynamic Column Selection in a Table Visual
- 8 months ago
Hi mohit01chugh,
Thank you for sharing the screenshots. This behavior is expected, Power BI retains a column and its header in the visual even if all its cells are blank, so hiding values won’t remove the Sale header.
To address this, you have three options:
1.Use Field Parameters (recommended) by creating a parameter with Stock and Sale fields, adding it to your Table or Matrix, and controlling it with a slicer so only the selected field appears;
2.Unpivot the Stock and Sale columns in Power Query, then use the Attribute field in a Matrix and control which attributes display with a slicer; 3.Set up separate visuals for Stock-only, Sale-only, and both, then toggle between them using a slicer and bookmarks.
Field Parameters offer the best user experience, unpivoting is most model-friendly, and bookmarks are a straightforward alternative.
Thank you.
Hi mohit01chugh,
Since we haven't heard back from you yet, I'd like to confirm if you've successfully resolved this issue or if you need further help?
If you still have any questions or need more support, please feel free to let us know.
We are more than happy to continue to help you.