Forum Discussion
Calculated measure with filter
- 4 years ago
Hi MarcDT21
I didn't know what FZ column represents for so I ignored that in previous reply. Anyway, try this new measure 2:
Measure 2 = VAR current_FZ_table = FILTER(ALL('Table'),'Table'[FZ]=SELECTEDVALUE('Table'[FZ])) VAR last_true_date = MAXX(FILTER(current_FZ_table,'Table'[KontrOelAdblueect]=TRUE()),'Table'[Datum]) VAR last_true_date_KM = MAXX(FILTER(current_FZ_table,'Table'[Datum]=last_true_date),'Table'[KMEnde]) VAR last_date = MAXX(current_FZ_table,'Table'[Datum]) VAR last_date_KM = MAXX(FILTER(current_FZ_table,'Table'[Datum]=last_date),[KMEnde]) RETURN last_date_KM - last_true_date_KMRegards,
Jing
If this post helps, please Accept it as Solution to help other members find it.
Dear v-jingzhang
Thank you very much for you two measures. The second measure is exactly what I was looking for. Unfortunately I still have troubles.
When I try out the measure with steps then (e.g. first give me back the "last_true_date" then it will give me for all cars the last date of the last true - instead of each and every car its own last true date. -> see first picture.
Thank you very much for helping me!
Results with measure2
results with measure 2
Measure with steps
last true datelast km when true date
Hi MarcDT21
I didn't know what FZ column represents for so I ignored that in previous reply. Anyway, try this new measure 2:
Measure 2 =
VAR current_FZ_table = FILTER(ALL('Table'),'Table'[FZ]=SELECTEDVALUE('Table'[FZ]))
VAR last_true_date = MAXX(FILTER(current_FZ_table,'Table'[KontrOelAdblueect]=TRUE()),'Table'[Datum])
VAR last_true_date_KM = MAXX(FILTER(current_FZ_table,'Table'[Datum]=last_true_date),'Table'[KMEnde])
VAR last_date = MAXX(current_FZ_table,'Table'[Datum])
VAR last_date_KM = MAXX(FILTER(current_FZ_table,'Table'[Datum]=last_date),[KMEnde])
RETURN
last_date_KM - last_true_date_KM
Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it.