Forum Discussion

aktripathi2506's avatar
9 years ago
Solved

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.

  • 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)

4 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    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)
    • aktripathi2506's avatar
      aktripathi2506
      Helper IV

      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.

       

       

       

       

      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        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?