Forum Discussion

mohit01chugh's avatar
mohit01chugh
Frequent Visitor
8 months ago
Solved

Dynamic Column Selection in a Table Visual

The objective is to implement a single, dynamic slicer that controls which specific columns from the main sales data table are displayed in an adjacent Table visual. Input Data: A single sales d...
  • v-sgandrathi's avatar
    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.