Forum Discussion

bernate's avatar
bernate
Icon for Helper III rankHelper III
1 year ago
Solved

Measure to show all rows in table visual when other table doesn't have those values

Hello! I have 2 tables: Employees and Hours. I am trying to make a table visual to show Employees and their Hours Worked. 

 

Emplopyees are connected to Hours with Many-to-One on Employee ID, with many Employee IDs on the Hours table and no duplicate Employee IDs on the Employee table. 

 

Not every Employee has worked hours, so they will not appear on the Hours table. When I make a table visual, I add the Employee Name column from the Employee table and have 17 employees. I then add the Hours column from the Hours table, and my employee count drops to 9 because I have 8 employees who have not worked hours. 

 

I would still like to show those 8 employees on the table visual, but either with a 0 or Blank in the hours column. I know I can add a calculated column to the Employees table summing the hours from the Hours table, but can this be done with a measure instead? I tried IF(SUM('Hours'[Hours])=BLANK(),0,SUM('Hours'[Hours])), but this returns all employees and ignores the slicers I have on the page.

 

Thank you!

  • Hi bernate 

     

    You can add 0 to a measure to force Power BI to show all rows. Example SUM('Hours'[Hours]) + 0

    Or you can enable Show items with no data

     

     

4 Replies