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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Dehlilah
Regular Visitor

Displaying "0" in table or matrix

Hello, 

 

I created a code to sum sub-categories and the code works. However, I want to visualize areas that have zero as a value as this is important to know regions without. 

 

Here is my code: 

 

Remaining =

VAR Total =

    CALCULATE(

        SUM('Table'[Column1]),

        FILTER(

            'Table',

            'Table'[Column 2] = "x1" ||

            'Table'[Column 2] = "x2" ||

            'Table'[Column 2] = "x3"

        )

    )

RETURN

    IF(

        ISBLANK(Total),

        0,

        Total

    )

 

I have tried adding "<>0" or "+0" after the paranthesis, using the "show items with no data" option next to the variable and I have tried a different code: 

 

Remaining =

COALESCE(

   

CALCULATE(

        SUM('Table'[Column1]),

        FILTER(

            'Table',

            'Table'[Column 2] = "x1" ||

            'Table'[Column 2] = "x2" ||

            'Table'[Column 2] = "x3"

        )

    )

,

    0

)

 

Can anyone offer a change to help visualize all the data? 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @Dehlilah,

In fact, this should be divided to two scenarios to handle your requirement.
If these records real include in your table, you can simply write a Dax expression and use if statement to check and replace them.
If these blanks case with table records missing, you may need to create a unconncted new table(as lbendlin said)with whole category values to use on matrix column field. Then you can extract the current table row and new table column value as condition to lookup records and return default value if this row/column value group does not include in your table.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Dehlilah,

In fact, this should be divided to two scenarios to handle your requirement.
If these records real include in your table, you can simply write a Dax expression and use if statement to check and replace them.
If these blanks case with table records missing, you may need to create a unconncted new table(as lbendlin said)with whole category values to use on matrix column field. Then you can extract the current table row and new table column value as condition to lookup records and return default value if this row/column value group does not include in your table.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
lbendlin
Super User
Super User

To report on things that are not there you need to use disconnected tables and/or crossjoins

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors