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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
BIswajit_Das
Super User
Super User

Power bi Matrix column value Based on count

How we can display 0 on Power bi Matrix Column value when there's some data missing in the data table

cadidatevotegroup
a5%0-10%
c10%0-10%
b15%11-20%
w9%0-10%
c39%31-40%
x45%41-50%
d33%31-40%

 

getting answerCOUNT
0-10%3
11-20%1
31-40%2
41-50%1
TOTAL7

 

Needed AnswerCOUNT
0-10%3
11-20%1
21-30%0
31-40%2
41-50%1
TOTAL7
1 ACCEPTED SOLUTION
Anonymous
Not applicable

You will have to create a new table with the groups you want as there are no references in the table for Power BI to add a 0 agains it. 

reidnmorrison_0-1675433729649.png

You can then create a relationship between the two tables like this

reidnmorrison_1-1675433743834.png

The next step is to create a measure that will replace the blanks with 0.

Measure = 
VAR total_rows =
    COUNTROWS('Group_data')
Return
    COALESCE(total_rows, 0)

I have called my table 'Group_data'. You will need to replace the bit in green with the name of your table.

 

You will then need to use this measure along with the column in the new table you have created in a matix

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

In the visualisation pane click on the drop down  

reidnmorrison_1-1675417973687.png

then make sure 'Show items with no data' is selected. 

reidnmorrison_0-1675417799735.png

 

Not exactly working can we provide an example for better understanding. Thank you

Anonymous
Not applicable

You will have to create a new table with the groups you want as there are no references in the table for Power BI to add a 0 agains it. 

reidnmorrison_0-1675433729649.png

You can then create a relationship between the two tables like this

reidnmorrison_1-1675433743834.png

The next step is to create a measure that will replace the blanks with 0.

Measure = 
VAR total_rows =
    COUNTROWS('Group_data')
Return
    COALESCE(total_rows, 0)

I have called my table 'Group_data'. You will need to replace the bit in green with the name of your table.

 

You will then need to use this measure along with the column in the new table you have created in a matix

Thanks the visual explanation is really helpfull

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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