Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi everybody,
I am trying to calculate the difference of the KM between the checklists, for the same car plate (DescPlaca), and I am trying to do the Context in the same way I would do for DATEDIFF, but for some reason it does not work. Can anybody help me with this, please?
I wanna calculate the "Digite a KM" value less the Previous checklist "Digite a KM" value, for this, I have to use IdChecklist, so the IdChecklist for the first term has to be bigger than IdChecklist for the second term, and DescPlaca has to be equal.
I am trying to use the following dax. can anybody spot what is wrong, please?
Hi @amitchandak, I was trying to create as a measure, now I tried to create anew column.
In the var _min calculation, the Dax recognizes the columns DescPlaca and IdQuestionario, but in the calculation in the return, these columns are not recognized. The following mesage appears:
@renanc , A new column like
Diferenca KM =
var _min =
CALCULATE(
FIRSTNONBLANK(fChecklists[IdChecklist],0),
FILTER(
ALL(fChecklists),
fChecklists[IdChecklist] > EARLIER([IdChecklist])
&& fChecklists[DescPlaca]=EARLIER([DescPlaca])
&& fChecklists[DtCadastro] >= EARLIER([DtCadastro])
&& fChecklists[IdQuestionario] = EARLIER([IdQuestionario])
)
)
return
CALCULATE(
min([Digite a KM])
FILTER(
ALL(fChecklists),
fChecklists[IdChecklist] = _min
&& fChecklists[DescPlaca]=EARLIER([DescPlaca])
&& fChecklists[IdQuestionario] = EARLIER([IdQuestionario])
)
) - [Digite a KM]