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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
aktripathi2506
Helper IV
Helper IV

Show items with no data: show items from one table based on data (no data) from other table

Hi,

 

Please consider following senario:

 

Table 1

 

NameID
A1
B2
C3
D4
E5
F6
G7
H8

 

 

Table 2

 

 

DateIDHours spent
26-09-201611
26-09-201611
26-09-201621
26-09-201631
27-09-201611
27-09-201621
27-09-201631
27-09-201611
27-09-201621
27-09-201631
28-10-201611
28-10-201621
28-10-201631

 

 

Relation between table 1 and table 2 is  -->  1 to many relation, both directional 

 

Based on date from table 2, I have 2 slicer week and year.

 

When I select week 40 and year 2016, I get following output:

 

NameHour Spent
A5
B4
C4

 

My desired output is:

 

NameHour Spent
A5
B4
C4
D 
E 
F 
G 
H 

 

for remaining employee who has no hours in table 2, either it should be 0 or null. The problem is we are not having any data for other names for those dates in Table 2 thats why it is not showing name, even if I enable show items with no data than also I am not able to get these name. 

 

I was trying to do something like allexcept  where we can simply ignore the week slicer for display but not getting how to do it.

 

To summurise my problem in one line:

I want to display the name of all the employee and their hours spent details (where it is 0 or some value)

 

Please suggest possible solution.

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

First, bravo for posting a clear explanation of the problem and sample data that is not a screen shot and thus has to be manually entered in order to replicate the problem. Nice job.

 

What you want is this Measure in your Names table:

 

MyMeasure = IF(SUM(HoursSpent[Hours spent])>0,SUM(HoursSpent[Hours spent]),0)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

First, bravo for posting a clear explanation of the problem and sample data that is not a screen shot and thus has to be manually entered in order to replicate the problem. Nice job.

 

What you want is this Measure in your Names table:

 

MyMeasure = IF(SUM(HoursSpent[Hours spent])>0,SUM(HoursSpent[Hours spent]),0)

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thank you @Greg_Deckler,

 

It solved the part of my problem now instead of getting blank I am getting 0 but I am still not getting the name of those employee who has not put any hours in Table 2.

 

 

 

 

I don't understand, if I create a table visualization with [Name] and [My Measure], I see all the names including the ones that have 0. Are you seeing something different or are you using a different visualization?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Sorry @Greg_Deckler, I was having one more condition enabled bacause of that I was getting different values. I changed it.

 

Now all good, It worked and solved the problem. Thank you for the quick responce.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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