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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
elopez
Helper I
Helper I

Replacing blank fields in a matrix table with 0's

I have tried several way to replace the blank boxes with 0's in my matrix table and nothing works. The matrix table shows counts of the field 'Faculty Rank' and some counts are blank since there are 0 records. I want to replace those blank fields with 0. Here are the 3 ways i tried already:

1) adding +0

2) creating a new measure within my table: 

Measure =
IF(ISBLANK(COUNT('FT-cal-acad-faculty only'[Faculty Rank])),0,COUNT('FT-cal-acad-faculty only'[Faculty Rank]))
3) creating a new table and measure (when using this i cannot relate the tables though so that's the first problem):
new table: 
DISTINCT('FT-cal-acad-faculty only'[Faculty Rank])
new measure: 
IF(ISBLANK(COUNT('FT-cal-acad-faculty only'[Faculty Rank])),0,COUNT('FT-cal-acad-faculty only'[Faculty Rank]))
 
Although all of these pass, the 0 is never displayed. They all display the same thing (as if I  had done nothing, they all just appear as the original count shows up in the matrix)
3 REPLIES 3
amitchandak
Super User
Super User

@elopez ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

I tried to replicate the file. hopefully it helps and we are able to figure it out! 

File:

https://iu.box.com/s/m6rrz07lxmmq6adc30tij8k2fqiqd7vi

 

Data source:

https://iu.box.com/s/dswykrnfix9a5y0xxi8ofcjf0gqibb4d

 

@amitchandak 

mahoneypat
Microsoft Employee
Microsoft Employee

Your #3 approach is the way to get there. Make your DISTINCT() table, use the new column in your visual, and use TREATAS() in a new measure.  Something along these lines

 

NewMeasure = CALCULATE([OldMeasure], TREATAS(VALUES(NewTable[Column]), OldTable[Column])) + 0

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors