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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Wilbike
Regular Visitor

Data tables filters not applying desired filter context in DAX expression

Hi Power BI-ers! 


I'm in need of a little support with understanding how to correctly apply filter context from the tables in my data model. To help understand the problem, I've shared a copy of my data model below with the established relationships:

 

Wilbike_0-1705325160801.png

Relationships:
Forcast[EmployeeID] - Employee Lookup [EmployeeID]

Employee Lookup[Country] - Country [Country]

Holidays [Country] - Country[Country]

Holidays[Date] - Calendar[Date]

 

In short, I have a list of employees and the days they dedicate to staff in my "Forcast" table. This is linked to an Employee ID table stores information about individual employees. I then have a list of holidays for different countries in "Holidays". I've linked this to my employee table through the "Country" key.

 

The problem

The problem I'm struggling with is working out the total number of public holidays for employees as people are based in different countries and thus have different public holidays. When I try to accomodate for this in my dax measure (applying filters from my "Holidays" table to the "Forecast" table), it seems that the Country filter applied from my Holiday table does not affect the output. See an example measure I'm using below to work out the number of working days in the UK that are not holidays (the output stays the same whether I include "Holidays[Country] <> "United Kingdom"" or exclude it:

CALCULATE(
    COUNTROWS('Calendar_'),
    'Calendar_'[Day Name] <> "Saturday",
    'Calendar_'[Day Name] <> "Sunday",
    Holidays[Country] <> "United Kingdom"
)

 

The desired outcome I want is: Calculate all the working days for employees where country of residence = "United Kingdom" . 

 

If anyone can offer any support I would be eternally grateful! 

Happy to provide more info if needed :).

 

Thank you

 
1 REPLY 1
DataInsights
Super User
Super User

@Wilbike,

 

Try adding CROSSFILTER to your measure as follows. This allows filtering each direction within the measure.

 

United Kingdom Working Days =
CALCULATE (
    COUNTROWS ( 'Calendar_' ),
    'Calendar_'[Day Name] <> "Saturday",
    'Calendar_'[Day Name] <> "Sunday",
    Holidays[Country] = "United Kingdom",
    CROSSFILTER ( Holidays[Date], Calendar[Date], BOTH )
)

 

You may be able to remove the table Country Key, since filter context using the DAX above goes from Holidays --> Calendar --> Forecast.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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