Forum Discussion
amandabus21
3 years agoHelper V
Difference in Values
Hello, How can I get a differene from the last value? In this example I need the difference in mileage from the last entry. (24,695 - 18,923) (30,781 - 24,695) etc Example) Shou...
amandabus21
3 years agoHelper V
tamerj1
3 years agoCommunity Champion
- amandabus213 years agoHelper V
Ok got it:
Change in Mileage = SUMX (FILTER ('PM On Time Performance Bus PM-BI-002 (2)','PM On Time Performance Bus PM-BI-002 (2)'[Equipment.Equipment Level 01.Key] <= EARLIER ( 'PM On Time Performance Bus PM-BI-002 (2)'[Equipment.Equipment Level 01.Key] )),'PM On Time Performance Bus PM-BI-002 (2)'[Mileage])just need to apply the 0 else from before - amandabus213 years agoHelper V
tamerj1 That isnt the date i was using, but I changed it anyways. Still getting the same wrong values.
- tamerj13 years agoCommunity Champion
Can you please share a sample file?
- amandabus213 years agoHelper V
It wont let me attach a PBIX file
- tamerj13 years agoCommunity Champion
You can share a download link
- amandabus213 years agoHelper V
I'm not sure where I would create a link from.
Maybe this may make more sense, this is the orginal Variable equation from Business Objects:
(Equipment key is Equipmemt.Equipment Level 01.Key)
=(If Previous([Equipment - Key]) <> [Equipment - Key] Then 0 Else [Mileage] - Previous([Mileage]))
- tamerj13 years agoCommunity Champion
- amandabus213 years agoHelper V
tamerj1 thank you so much for all your help! Just have one more question, do you know if I can put a rule or condition for that DAX statement to run only if the Equipment does not equal the previous? Otherwise it should default to 0