cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Resolver III

## 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

 cadidate vote group a 5% 0-10% c 10% 0-10% b 15% 11-20% w 9% 0-10% c 39% 31-40% x 45% 41-50% d 33% 31-40%

 getting answer COUNT 0-10% 3 11-20% 1 31-40% 2 41-50% 1 TOTAL 7

 Needed Answer COUNT 0-10% 3 11-20% 1 21-30% 0 31-40% 2 41-50% 1 TOTAL 7
1 ACCEPTED SOLUTION
Resolver II

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.

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

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

4 REPLIES 4
Resolver II

In the visualisation pane click on the drop down

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

Resolver III

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

Resolver II

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.

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

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

Resolver III

Thanks the visual explanation is really helpfull

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors