Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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]
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |