Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Antmkjr
Post Patron
Post Patron

Hide column conditionally

https://drive.google.com/file/d/1xuZ-nFqetmKsjVW1EI4_VLMLSBV7feAD/view?usp=sharing

 

In the file attached,

 

Is there any way in which if Actuals is 0, hide the column itself, 

AnuTomy_0-1622718678244.png

 

Desired output,

 

AnuTomy_1-1622718879926.png

 

I think its impossible, but still asking because that came up as a requirement

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Antmkjr ,

There is no better way to hide the "column" base on the specific conditions, you can follow the suggestion by @amitchandak to unpivot the columns "Actuals" and "Forecasts", then create a matrix visual(Columns: Date hierarchy: Year, Month name & Attribute   Values: Value). Please find the details in the attachment.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZY9RCsQwCETv4nchjqaNniX0/teo1WR3YfFjYB7xmTlJG9CE4XQQmDnCPIbuY1JvsA0lGUQhyc4m52ae7IOu1oPI241rjAgFNNEoXTJnfyN7K1P22ntfKq2FXq7aaMP2K/ACiKbOg0iZ9A/p2iY/BOmLWf/9EknJ/QA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Actuals = _t, Forecast = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Actuals", Int64.Type}, {"Forecast", type number}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Date"}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Columns", each ([Value] <> 0))
in
    #"Filtered Rows"

yingyinr_0-1623060159583.png

yingyinr_1-1623060331511.png

In addition, you can review the content in the following threads, hope they can help you resolve the problem.

Hide/do not display empty columns in a matrix visual

Hide column in table visual if contents are 0

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Antmkjr ,

There is no better way to hide the "column" base on the specific conditions, you can follow the suggestion by @amitchandak to unpivot the columns "Actuals" and "Forecasts", then create a matrix visual(Columns: Date hierarchy: Year, Month name & Attribute   Values: Value). Please find the details in the attachment.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZY9RCsQwCETv4nchjqaNniX0/teo1WR3YfFjYB7xmTlJG9CE4XQQmDnCPIbuY1JvsA0lGUQhyc4m52ae7IOu1oPI241rjAgFNNEoXTJnfyN7K1P22ntfKq2FXq7aaMP2K/ACiKbOg0iZ9A/p2iY/BOmLWf/9EknJ/QA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Actuals = _t, Forecast = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Actuals", Int64.Type}, {"Forecast", type number}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Date"}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Columns", each ([Value] <> 0))
in
    #"Filtered Rows"

yingyinr_0-1623060159583.png

yingyinr_1-1623060331511.png

In addition, you can review the content in the following threads, hope they can help you resolve the problem.

Hide/do not display empty columns in a matrix visual

Hide column in table visual if contents are 0

Best Regards

amitchandak
Super User
Super User

@Antmkjr , You are correct as long it is a measure or column you can not hide it. You have to unpivot and make it as row value to hide

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.