Forum Discussion

jerryr125's avatar
jerryr125
Helper IV
1 year ago
Solved

Table Visualization - Hide a column

Hi - 

I have a table visualization and I would like to a hide the column if another column (variable) equals 0)

 

Example:

 

Food TypeAmount1Amount2Amount3
Ice Cream101510
Cake151230
Cookies81242

If variable Amount3Target = 0 then do NOT display column 3

 

Food TypeAmount1Amount2
Ice Cream1015
Cake1512
Cookies812

Any thoughts would be appreciated - Jerry

  • Hi jerryr125 ,

    Use a Matrix Instead of a Table

    • Use a Matrix visualization.
    • Drag Food Type to Rows.
    • Drag Amount1, Amount2, Amount3 to Values.
    • Apply a visual-level filter:
      "Show columns where Amount3Target is not 0."
      This will automatically remove the column when the target is 0.

    Please mark this post as solution if it helps you. Appreciate Kudos.

  • Hi jerryr125 ,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    Thank you lbendlin  and FarhanJeelani  for your prompt response.

     

    I have created the data where the Amount3 column contains both 0 and non-zero values. If Amount3 is 0, we first need to unpivot the data, then build the table using a Matrix visual. Next, apply a filter on the Value column to show only non-zero values. This ensures that the Amount3 column automatically hides when all its values are 0.

     

    The PBIX file is attached for reference. Let us know if you have any further questions!

     

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

4 Replies

  • Hi jerryr125 ,

    Use a Matrix Instead of a Table

    • Use a Matrix visualization.
    • Drag Food Type to Rows.
    • Drag Amount1, Amount2, Amount3 to Values.
    • Apply a visual-level filter:
      "Show columns where Amount3Target is not 0."
      This will automatically remove the column when the target is 0.

    Please mark this post as solution if it helps you. Appreciate Kudos.

  • Unpivot your data to bring it into usable format. Then apply the row filter accordingly.  Let the matrix visual do the re-pivoting.

  • v-sathmakuri's avatar
    v-sathmakuri
    Community Support

    Hi jerryr125 ,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    Thank you lbendlin  and FarhanJeelani  for your prompt response.

     

    I have created the data where the Amount3 column contains both 0 and non-zero values. If Amount3 is 0, we first need to unpivot the data, then build the table using a Matrix visual. Next, apply a filter on the Value column to show only non-zero values. This ensures that the Amount3 column automatically hides when all its values are 0.

     

    The PBIX file is attached for reference. Let us know if you have any further questions!

     

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

  • v-sathmakuri's avatar
    v-sathmakuri
    Community Support

    Hi  jerryr125 ,

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

    Thanks!!