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
sj_
Frequent Visitor

Show 0 in matrix when there is no data (blank) -- Count + 0 does not work

Can somebody help me with this?

How do I make a matrix show 0s instead of blank?

I tried 

  • if(isblank(count),0,count)
  • count + 0

but it doesn't work

 

Capture.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@sj_  - The problem is that all of the rows/columns come from the same table. There simply is no intersection of those attributes (they are filtered out of the result set). One way to fix this is by creating a Dimensional Model, where a fact table is related to dimension tables. Dimensional models are ideal in Power BI. For this particular case, your visual would behave as desired if you do the following:

1. Create a new Calculated Table:

Entity = DISTINCT(controls[Entity])

2. Replace Entity in the Matrix with Entity from the new Entity table.

Cheers,

Nathan

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

@sj_  - 

It's strange - Could you share your pbix?

Thanks,

Nathan

sj_
Frequent Visitor

https://drive.google.com/file/d/1Vnoe0MzD7AKlqmLA_Ioyl4wkDzP7jWRb/view?usp=sharing

 

here is the pbix file. Please let me know if you cannot open the file. and thank you for your help! 

Anonymous
Not applicable

Have you tried ISFILTERED or HASONEVALUE?

sj_
Frequent Visitor

Hi! Could you elaborate on this? 

ISFILTERED or HASONEVALUE takes an existing column as a parameter. What columns would you use to make 0s appear? 

Anonymous
Not applicable

@sj_  - The problem is that all of the rows/columns come from the same table. There simply is no intersection of those attributes (they are filtered out of the result set). One way to fix this is by creating a Dimensional Model, where a fact table is related to dimension tables. Dimensional models are ideal in Power BI. For this particular case, your visual would behave as desired if you do the following:

1. Create a new Calculated Table:

Entity = DISTINCT(controls[Entity])

2. Replace Entity in the Matrix with Entity from the new Entity table.

Cheers,

Nathan

sj_
Frequent Visitor

My real file is connected to a sql database, so unfortunately I cannot create a calculated table for this.

But, it makes sense to me why it is happening. Thank you so much for your help! 

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.