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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Shashi_s
New Member

Hide Columns with zero value in Matrix

Hello,

 

In Power BI - have a matrix with Rows- Category and Columns with Fiscal week numbers and Values with Sales units. I have to hide/surpass the fiscal week number columns with the values zero in sales units.

Please see the below snip for reference

Shashi_s_0-1690650178094.png

Is it possible to hide these columns?, for example - week 05, week 06.....


Thanks in advance

3 REPLIES 3
cocquer
New Member

very clever

jdbuchanan71
Super User
Super User

You can write your mesure so 0 is returned as BLANK which will leave it out of the matrix if all values in the column are blank.  We do this using a trick of multiplying a number by BLANK returns BLANK and DIVIDE by 0 returns BLANK.  
The first table has just a SUM measure.

Total Amount = SUM ( 'Table'[Amount] )

The second table has the measure to return BLANK for 0

Total Amount no 0 = 
VAR _Amount = SUM ( 'Table'[Amount] )
RETURN _Amount * DIVIDE (_Amount, _Amount)

You can see WEEK2 and WEEK3 are not showing in the second matrix.

jdbuchanan71_0-1690651819925.png

 

Anonymous
Not applicable

I tried this and my column is giving blank values but it hasn't gone off from the report. Is there anything more that you did? Like, chnaged some settings or something?
Would be great if you could add the pbix file as an attachment.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.