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
Anonymous
Not applicable

How to link two tables for using filters from one

I have two data tables

  1. Actual Hours (this has a lot more columns than Expected Hours table)

msfer_5-1644893938105.png

  1. Expected Hours

msfer_6-1644893970912.png

 

The two tables currently linked through [Employee Dim] and [PO Dim].

 

DAX for Hours Diff used is:

msfer_7-1644894028558.png

 

I am trying to show the difference between the Actual hours and the Expected hours. This is proving difficult.

The issue is my filters are all from Actual Hours table (eg. Manager). When these are used they don't seem to filter out the irrelevant data…

eg.

msfer_8-1644894123536.png

X - axis is "Employees"

 

in this visual I only want to show the employees that's under, say Manager A. Not all the employees. I am not sure if it's the way the tables are linked or the way the DAX is written. 

 

Hoping someone can shed some light on what I can do to correct this. 

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , You need to create common table like Employee(Employee manager) , PO, Date/Month and analyze data against common dimension

then sum('Expected Hour'[Hours])  - sum('Actual Hour'[Hours])

should work

 

Bridge Table: https://www.youtube.com/watch?v=Bkf35Roman8&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=19

 

Try to me in Star Shema

https://docs.microsoft.com/en-us/power-bi/guidance/star-schema

 

Anonymous
Not applicable

Hi @amitchandak 

Thanks for the quick response. I have two 'common' tables for Employees and PO, which are then linked to both tables in question (as mentioned above). 

@Anonymous , Date is also needed, Then you can add employee, manager from employee, PO and date from date and measure like this one

sum('Expected Hour'[Hours]) - sum('Actual Hour'[Hours])

 

In a visual

Anonymous
Not applicable

Ah good point.. dates were also joined through a Date table, but I'd used the wrong date field in table one. Fitlers working now thanks.  But the amount brought back when I use 
sum('Expected Hour'[Hours]) - sum('Actual Hour'[Hours])

is the same for each field. 

 

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.