Forum Discussion

leok's avatar
leok
Microsoft Employee
6 years ago
Solved

Calculated column do not respect page filter

Hi all.

I have some data like this:

 
idDateDim1
id101.01.2020A
id201.02.2020A
id301.02.2020A
id401.02.2020B

 

I want to show on report how many lines we have on given date (incling all previous dates)

I created a calculated column:

CountOnDate = CALCULATE(DISTINCTCOUNT('Table'[id]); FILTER('Table'; 'Table'[Date]<=EARLIER('Table'[Date])))
 
This gives me results exactly as I want:
 
And I created a line chart and set it to display MAX(CountOnDate).
Also I added Dim1 as page filter.
 
The problem is that when I select in filter Dim1=A I expect to  see CountOnDate only for A (1 on 01-01-2020 and 3 on 01-02-2020).
 
As I understand page filters can not affect filter context in DAX formulas. Then how can I achieve desired result (Display "Accumulated Count on date" respecting all user filters)?

3 Replies