Forum Discussion

b-kopik's avatar
b-kopik
Helper III
2 months ago
Solved

PowerBI Relationships

I’m working with two datasets in Power BI that both contain multiple rows per employee, but represent different types of information. Dataset 1: Combined Headcount Data Every month, I l...
  • Rupa01's avatar
    2 months ago

    Hi b-kopik,

     

    In this scenario, I would avoid directly relating the two fact tables (Headcount & Campus) using a many-to-many relationship. Since both tables contain multiple rows per Employee ID, a direct relationship can create ambiguous filtering and incorrect results.

    A better approach is to model this as a star schema, using shared dimension tables. Microsoft also recommends organizing Power BI models with fact and dimension tables for better filtering, usability, and performance.

    Refer - Understand star schema and the importance for Power BI - Power BI | Microsoft Learn

     

    ✔️Correct Approach for creating relationships - 

    DimEmployee[Employee ID] 1-* FactHeadcount[Employee ID]
    DimEmployee[Employee ID] 1-* FactCampus[Employee ID]
    DimDate[Date] 1-* FactHeadcount[Month/Date]
    DimDate[Date] 1-* FactCampus[Course Date]
     
    💡 Helpful? Give a Kudos 👍 — keep the community growing
     Solved your issue? Mark as Solution ✔️ — help others find it faster

    Best regards,
    Rupasree Achari | BI & Fabric Analytics Engineer