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,
we haven't heard back from you regarding our last response and wanted to check if your issue has been resolved.
Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!
- mohit01chugh8 months agoFrequent Visitor
Thanks for the follow-up. Apologies for the delayed response.
Refer to the Input data and Expected Output.I tried with a solution, where "Stock" is selected: Show the two relevant Stock columns, and the Sale relevant values are blank, that's okay, but the Sale header is still reflected in the table