cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Regular Visitor

## Calculated table ignoring applied filters

Hi all,

I'm facing an issue with the creation of a calculated table. I have two tables: a DimDate table and a table "DimWerknemer" containing employees including the dates they started and left the company.

The goal is to create a calculated table showing all employees that were active in the selected period of the DimDate table.

The DAX code below is giving a table containing all employees, it seems to be ignoring the applied filters on DimDate[Dag].

`ActiveUsers = VAR MinDate = CALCULATE(MIN('DimDate'[Dag]),KEEPFILTERS(DimDate))VAR MaxDate = CALCULATE(MAX('DimDate'[Dag]),KEEPFILTERS(DimDate)) RETURNCALCULATETABLE('DimWerknemer','DimWerknemer'[InDienstVanaf]<=MaxDate,'DimWerknemer'[InDienstTot]>=MinDate)`

Any help would be appreciated.

3 REPLIES 3
Helper I

I have a similar concept table in one of my reports.

Helper I

AMMENDED as I meant FILTER NOT SUMMARIZE

``````ActiveUsers =

VAR MinDate =
CALCULATE(MIN('DimDate'[Dag]),KEEPFILTERS(DimDate))

VAR MaxDate =
CALCULATE(MAX('DimDate'[Dag]),KEEPFILTERS(DimDate))

RETURN
FILTER('DimWerknemer','DimWerknemer'[InDienstVanaf]<=MaxDate,'DimWerknemer'[InDienstTot]>=MinDate)``````

Memorable Member

Hi,

calculated tables are calculated during refresh. There is no filter context during refresh, so your MinDate and MaxDate will always give the min and max date of the whole date table.

Announcements

#### Fabric certifications survey

Certification feedback opportunity for the community.

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors