Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

DAX issue with USERRELATIONSHIP

Hi Community,

I need help with a measure. I have 2 tables from different sources and a Calender table. I related the two tables with an inactive relationship, so that I could use userrelationship in a measure. I have used a measure from table1 in table2. The results are different.  M_hrs worked is the measure from table1, used as 'hrs_wrkd' in table2. On the report, for comparision sake I have two separate pages.

Please suggest how can I fix this. 

 

 

TIA

  • Anonymous  I'm not sure what the difference is between your two tables. You have two main options: 

    Option A: Combine the two tables using an append if they have similar columns


    Option B: (This is what I'm guessing you might choose??) You will need a Dimension table for every value you want to compare both tables by. You already have Date, but you need one for Employee. So create a DimEmployee table that has each employee once exactly, relate that to both tables using 1 to many. You don't need your inactive relationship anymore. Use the DimEmployee[Employee] in all your visuals and then it will create measures accurately. 

     

    Excel with Allison: It's Complicated: Relationships in Power BI Part 1 (Fact vs Dimension)

1 Reply

  • AllisonKennedy's avatar
    AllisonKennedy
    Community Champion

    Anonymous  I'm not sure what the difference is between your two tables. You have two main options: 

    Option A: Combine the two tables using an append if they have similar columns


    Option B: (This is what I'm guessing you might choose??) You will need a Dimension table for every value you want to compare both tables by. You already have Date, but you need one for Employee. So create a DimEmployee table that has each employee once exactly, relate that to both tables using 1 to many. You don't need your inactive relationship anymore. Use the DimEmployee[Employee] in all your visuals and then it will create measures accurately. 

     

    Excel with Allison: It's Complicated: Relationships in Power BI Part 1 (Fact vs Dimension)