Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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 @renanc,
You can try to use the following formula if helps: (I try to lookup the previous date based on the current place and date)
Diferenca KM =
VAR _prevDate =
CALCULATE (
MAX ( fChecklists[Date] ),
FILTER (
fChecklists,
fChecklists[Date] < EARLIER ( fChecklists[Date] )
&& fChecklists[DescPlaca] = EARLIER ( [DescPlaca] )
&& [Digite a KM] <> BLANK ()
)
)
RETURN
CALCULATE (
SUM ( [Digite a KM] ),
FILTER (
fChecklists,
fChecklists[Date] = _prevDate
&& fChecklists[DescPlaca] = EARLIER ( [DescPlaca] )
)
) - fChecklists[Digite a KM]
Regards,
Xiaoxin Sheng
HI @renanc,
You can try to use the following formula if helps: (I try to lookup the previous date based on the current place and date)
Diferenca KM =
VAR _prevDate =
CALCULATE (
MAX ( fChecklists[Date] ),
FILTER (
fChecklists,
fChecklists[Date] < EARLIER ( fChecklists[Date] )
&& fChecklists[DescPlaca] = EARLIER ( [DescPlaca] )
&& [Digite a KM] <> BLANK ()
)
)
RETURN
CALCULATE (
SUM ( [Digite a KM] ),
FILTER (
fChecklists,
fChecklists[Date] = _prevDate
&& fChecklists[DescPlaca] = EARLIER ( [DescPlaca] )
)
) - fChecklists[Digite a KM]
Regards,
Xiaoxin Sheng
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
21 | |
15 | |
14 | |
11 | |
7 |
User | Count |
---|---|
25 | |
24 | |
12 | |
12 | |
11 |