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
- answeriver6 years agoHelper IV
Hi all,
How i can use formula which help me make sameperiod last month.
Now i use this, but it's error (red text)
SPLM = CALCULATE([mln st];REPORT_IMS[VISIT YEAR]=YEAR(TODAY());'REPORT_IMS'[VISIT MONTH]=MONTH(TODAY())-1;REPORT_IMS[WORKING DAY]<=CALCULATE(MAX(REPORT_IMS[WORKING DAY];DATESMTD(REPORT_IMS[VISIT DATE]))))How i can fix it?Basically i need sales (mln st) in previous month in same count of working days in this month - Anonymous4 years agoNot applicable
Hello, Thank you for the help.
In my case, I want to get the max date depending on the filter and go back a year.
For example, if the selected date on the Real date filter is 6/22/2022. I want to filter another customer table where customer date equals 6/22/2021.