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
Mako75
New Member

DAX Measure to count records in one table but ignore the slicer from another joined table

I have a complex model, and a portion of which is displayed below. I'm trying to create a measure that counts the number of 'Base IDs' and that can be filtered by specific columns within the attributes table (via filter/slicer). However, a 'Locale' slicer based upon Locale.Locale should not affect the value should it be changed.

Mako75_1-1687953370612.png


I have created the following measure, but unfortunately the value changes if the Locale.Locale slicer is changed:

 

# Base ID = 
CALCULATE ( COUNT ( Base[Base ID] ), RELATEDTABLE ( Attributes ) )

 

I have also tried the following measure, but then any slicer/filter applied to 'Attributes' does not work:

 

# Base ID = 
CALCULATE (
    COUNT ( Base[Base ID] ),
    ALL ( Locale ),
    RELATEDTABLE ( Attributes )
)

 

 What am I missing?

Many thanks in advance

1 ACCEPTED SOLUTION
MarkLaf
Super User
Super User

I believe the piece you are missing is that you need to modify the filters on the Attributes table, not the Base table. You can do this with CALCULATETABLE. E.g., I think something like this will achieve what you want:

Count_IgnoreLocal =
CALCULATE(
  COUNTROWS( Base ),
  CALCULATETABLE(
    Attributes,
    REMOVEFILTERS( Locale )
  )
)

 

View solution in original post

4 REPLIES 4
MarkLaf
Super User
Super User

I believe the piece you are missing is that you need to modify the filters on the Attributes table, not the Base table. You can do this with CALCULATETABLE. E.g., I think something like this will achieve what you want:

Count_IgnoreLocal =
CALCULATE(
  COUNTROWS( Base ),
  CALCULATETABLE(
    Attributes,
    REMOVEFILTERS( Locale )
  )
)

 

Thanks MarkLaf.

Works a treat.

JoBI
Resolver II
Resolver II

You can try something like this:

# Base ID = 
CALCULATE ( COUNT ( Base[Base ID] ), CROSSFILTER(Attributes[Identifier Locale Key], Locale[Key]), None )

Thanks JoBi,

I have tried something similar before, but it doesnt work when applying a slicer etc from the Attributes table.
I am also concerned about the performance as there are more than a millions records in the Attributes table.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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