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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Solution Sage
Solution Sage

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
v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
aduguid
Solution Sage
Solution Sage

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors