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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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.

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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.