Forum Discussion
Date filter in Calculate function
- Anonymous7 years ago
"The question is: With what dax expression can I substitute VALUE (28/06/2019) for the FINAL DATE of the "Real" table ? (28/06/2019 is the last date of the "Real" table)."
Well, that's rather simple:
[Very Last Date in Real] := calculate( max( Real[Date] ), all( Real ) )and here's how you'd use it:
var __lastDateInReal = [Last Date in Real] return calculate ( sum ( Ppto[importe] ); KEEPFILTERS( Calendario[Date] <= __lastDateInReal ) )
if you want to intersect filters on Calendario that are coming from the outer context... and this is probably what you want to do.
Best
Darek
"The question is: With what dax expression can I substitute VALUE (28/06/2019) for the FINAL DATE of the "Real" table ? (28/06/2019 is the last date of the "Real" table)."
Well, that's rather simple:
[Very Last Date in Real] :=
calculate(
max( Real[Date] ),
all( Real )
)and here's how you'd use it:
var __lastDateInReal = [Last Date in Real] return calculate ( sum ( Ppto[importe] ); KEEPFILTERS( Calendario[Date] <= __lastDateInReal ) )
if you want to intersect filters on Calendario that are coming from the outer context... and this is probably what you want to do.
Best
Darek
Hi all,
How i can use formula which help me make sameperiod last month.
Now i use this, but it's error (red text)