Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi everybody, I have a calculated value on Dax, but it calculates the value between the current fuel fill and the next one. I want to calculate the value between the current fuel fill and the previous one. Can abybody help me with this, please?
The Dax formula used is here, and attachet below.
Thank you
Solved! Go to Solution.
Hi @v-jayw-msft I found the solution for this case, it was:
Hi @renanc ,
Please share some sample data so that we could test the formula on it.
Best Regards,
Jay
Hi @v-jayw-msft I found the solution for this case, it was:
Hi @johnt75, actually it did not work. In the new column (Diferenca KM 2), the values are negative values of those we have in Digite a KM. Probably the term inside
CALCULATE ( MIN ( [Digite a KM] ), FILTER ( ALL ( fChecklists ), fChecklists[IdChecklist] = _max && fChecklists[DescPlaca] = EARLIER ( [DescPlaca] ) && fChecklists[IdQuestionario] = EARLIER ( [IdQuestionario] ) )
is returning 0 or a null value, and then subtracting [Digite a KM].
Thank you for your help
You can try
Diferenca KM =
VAR _max =
CALCULATE (
LASTNONBLANK ( 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] = _max
&& fChecklists[DescPlaca] = EARLIER ( [DescPlaca] )
&& fChecklists[IdQuestionario] = EARLIER ( [IdQuestionario] )
)
) - [Digite a KM]
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
57 | |
49 | |
44 | |
18 | |
18 |