Forum Discussion
MarcDT21
4 years agoFrequent Visitor
Calculated measure with filter
Hi there! I would like to answear the qestion, "how many kilometers have been driven since the last inspection?" Was the inspection (KontrOelAdblueetc) made then it's TRUE. So I somehow need to get...
- 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.
wdx223_Daniel
4 years agoCommunity Champion
last_true_date=VAR _current=max(date[date]) RETURN maxx(filter(all(date[date]),date[date]<_current&&[KontrOelAdblueetc]),date[date])
MarcDT21
4 years agoFrequent Visitor
dear wdx223_Daniel I thought I used your querry as intended, but results tell me otherwise. It gives me an odd date back. Could you please help me showing what I did wrong?