Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
ahmedshalabyy12
Resolver II
Resolver II

Problem in The Relationships

Dears , 

I have 3 dimensions and one fact as following :

1- Dim_Date One to Many ( Fact_Email)

2- Dim_Site_code One to many (Fact_Email)

3- Dim_Operational_unit_Id  One to Many (Fact_Email)

 

ahmedshalabyy12_0-1762270894822.png

supposed when i use site as a slicer to filter the number of the Operational Units  in this site but it doesn't work 

 

there's no filters on the page or the visuals applied 
Count of Operational Unit no slicers 

ahmedshalabyy12_2-1762271051081.png

 



Count Operational Unit with slicers 

 

ahmedshalabyy12_3-1762271065588.png



Both site code and operational unit in the slicers iam using them from the dimensions 

 

so why i the number of the operational units related to this site not filtered ? 

 

Thank you 

 

 

2 ACCEPTED SOLUTIONS
mh2587
Super User
Super User

The reason is that Power BI’s relationships only filter one way (from dimension -> fact).
So when you filter Site, it affects the fact table, but that filter doesn’t flow back to the Operational Unit dimension.
Both Site and Operational Unit are dimensions , so the filter doesn’t move between them by default.

Count of Operational Units = //Try this and put in the card
CALCULATE(
    DISTINCTCOUNT('Dim_OperationalUnit'[OperationalUnit_id]),
    TREATAS(
        VALUES('Dim_Site_Code'[Site_Code]),
        'Fact_Email'[Site_Code]
    )
)

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



View solution in original post

parry2k
Super User
Super User

@ahmedshalabyy12 @mh2587 provided great solution but here are the alternate approaches:

 

Count of Operational Units = //Try this and put in the card
DISTINCTCOUNT('Fact Table'[OperationalUnit_id])


//2nd approach:
CALCULATE ( 
     COUNTROWS ( 'Dim Operational Unit' ),
     CROSSFILTER ( FactTable[OperationalUnitId], 'Dim Operational'[OperationalUnitId], BOTH )
)

 

Basically, in the 2nd measure (above), you are creating a fact table to filter the operational dimension table.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

@ahmedshalabyy12 @mh2587 provided great solution but here are the alternate approaches:

 

Count of Operational Units = //Try this and put in the card
DISTINCTCOUNT('Fact Table'[OperationalUnit_id])


//2nd approach:
CALCULATE ( 
     COUNTROWS ( 'Dim Operational Unit' ),
     CROSSFILTER ( FactTable[OperationalUnitId], 'Dim Operational'[OperationalUnitId], BOTH )
)

 

Basically, in the 2nd measure (above), you are creating a fact table to filter the operational dimension table.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

mh2587
Super User
Super User

The reason is that Power BI’s relationships only filter one way (from dimension -> fact).
So when you filter Site, it affects the fact table, but that filter doesn’t flow back to the Operational Unit dimension.
Both Site and Operational Unit are dimensions , so the filter doesn’t move between them by default.

Count of Operational Units = //Try this and put in the card
CALCULATE(
    DISTINCTCOUNT('Dim_OperationalUnit'[OperationalUnit_id]),
    TREATAS(
        VALUES('Dim_Site_Code'[Site_Code]),
        'Fact_Email'[Site_Code]
    )
)

Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors