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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Filtering a Calculation

I would like to calculate a count for a data set removing portions of a cross filter.  Below is a example of the mapping relationship.

 

Table1 

Department Code     Group Code

AAA                          111

BBB                          222

BBB                          333

CCC                         444

 

Table2

Department  Department Name

AAA               Administration

BBB               Finance

CCC               Operations

 

Cardinality = Many to 1 & Cross Filter Direction = Both

 

When the report is filtered at the page level by Group Code, I would like to show a count of all records for the corresponding Department regardless of the Group Code. 

 

EX.  Page Filter is set for Group code 333.  Trying to return a distinct count for all [No_ ] where Department is BBB (333's default department).  Assume 45 people assigned as BBB, 333 and 10 assigned as BBB, 222.  I am trying to return 55.

 

 I tried the formula below but it shows the count of all [No_] for every department unless Department is added to the visual.  

 

Count = CALCULATE(DISTINCTCOUNT('Employee'[No_]),ALL('Table1'[Group Code]))

 

 

1 REPLY 1
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

Could you please post your 'Employee' table and the relationship between these tables? Due to I could not understand what your desired result, based on my test, it should show the count of the department 'BBB', you could also download my pbix file to have a view.

1.PNG

 

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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