Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
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:
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:
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
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.
Proud to be a Super User!