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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
cboelterGNH
Frequent Visitor

How to show all Rows in matrix Even if there is no data

Hi,

I have a client-request that wants to show all rows of a Dimension Table (In this case all of the specific Departments) even when there are no values.

Example: a filter is set for a weekend and only one department works that weekend, so all departments will show 0 except one.

There are 44 Departments Total. The Dax is:

Example Hours = SUM(Fact_Timecards[Hours]) + 0

Below is what we don't want to happen (removing departments), the code field is the one from the Dimension Table. (I'm also using the show data with no values setting on the Rows [Code], clearly is not working).

2024-06-20 15_40_34-Overtime.png
Here is a look at the Model for Reference
2024-06-20 15_39_58-Hours.png

Though when I disactivate the relationship, I get the familiar repeated-value.

2024-06-20 15_43_33-Overtime.png

Any suggestions is welome, thank you.

1 ACCEPTED SOLUTION
aduguid
Super User
Super User

If you change the relationship to "Both" from Fact_Timecards to DepartmentCodes, it should work.

aduguid_1-1718923610675.png

 

aduguid_0-1718923593306.png

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @cboelterGNH ,

You can follow the steps below to get it:

1. Delete the relationship between the table 'Fact_Timecards' and 'DepartmentCodes'

2. Create a measure as below

Measure_ExampleHours =
VAR _code =
    SELECTEDVALUE ( 'DepartmentCodes'[Code] )
RETURN
    CALCULATE (
        SUM ( 'Fact_Timecards'[Example Hours] ),
        FILTER ( 'Fact_Timecards', 'Fact_Timecards'[Home Department-9999XX] = _code )
    )

3. Put the above measure onto the Values field to replace the original one

vyiruanmsft_0-1719194235140.png

Best Regards

aduguid
Super User
Super User

If you change the relationship to "Both" from Fact_Timecards to DepartmentCodes, it should work.

aduguid_1-1718923610675.png

 

aduguid_0-1718923593306.png

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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