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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to remove columns with only 0s as values in a matrix

I am having a matrix visualization like this

ann_2024_0-1705485946565.png

I want to remove the countries with 0 total sales (columns with full 0s) from the matrix. The matrix is dynamic so opting out some countries is not possible. The pack size and country names are columns from different tables and the values is a measure given below

 

Overall_Sales = 
var a  = HASONEFILTER('Date Master'[Day_final])
return
IF(a,CALCULATE([Sales],DATESMTD('Date Master'[Date])),[Sales])

 

Is there any way to eliminate the columns total (or countries) with 0 sales?

2 ACCEPTED SOLUTIONS
Ahmedx
Super User
Super User

pls try this

Overall_Sales =
var a = HASONEFILTER('Date Master'[Day_final])
VAR b = [Sales]>0
return
IF(a&&b,
CALCULATE([Sales],DATESMTD('Date Master'[Date])),IF(b,[Sales]))

View solution in original post

Anonymous
Not applicable

Hi @Anonymous 

You can create a new measure.

Measure =
IF ( [Overall_Sales] > 0, [Overall_Sales] )

Then put the measure to the matrix.

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous 

You can create a new measure.

Measure =
IF ( [Overall_Sales] > 0, [Overall_Sales] )

Then put the measure to the matrix.

 

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ahmedx
Super User
Super User

pls try this

Overall_Sales =
var a = HASONEFILTER('Date Master'[Day_final])
VAR b = [Sales]>0
return
IF(a&&b,
CALCULATE([Sales],DATESMTD('Date Master'[Date])),IF(b,[Sales]))

Vallirajap
Resolver III
Resolver III

Hi @Anonymous 

 

Choose the table and go to filter pane -> Expand the total sales filter card.

Select 'is greater than' and enter 0 in the text box, then click Apply Filter as in the below image.

Vallirajap_0-1705487125916.png

Did I answer your question?

Mark my post as a solution, this will help others...!

Hit the kudo also,

Thank you

Anonymous
Not applicable

Hi @Vallirajap 
Thanks for your response. I have tried this filter. It would remove the pack size with 0 sales. I need to remove the cities (columns) with 0 sales. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors