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.
Hello good afternoon to all I have been trying to solve a problem to show the kilometers traveled per vehicle per day
I have a table where the fuel tickets are recorded which consists of several fields, but the main ones are the following economic, loading date and the odometer of the day of the load
What I need is to obtain the mileage traveled by each vehicle on that day, for example the unit with economic number 592 of the day 02/01/2023 Cargo gasoline and its loading odometer was 175,885 and the day 05/01/2023 was 176,142 so in a new column there should be (km traveled) ----> (odometro_carga of 05/01/2023) - (odometro_carga of 02/01/2023) which would remain for the day 05/01/2303 = 257
1.- Details that the days are not consecutive, it can take several days until the next load,
being as follows:
How could I do it in Power BI Desktop?
achieve it for a general concetrado generating three measures
1.- initial odometer
2.-odometro_final
3.- RESULT
After paying more attention to the detail being as follows:
@Syndicate_Admin , A new column
tarvellled =
var _max = maxx(filter(Table , [economico] = earlier([economico]) && [feach_carga] < earlier([feach_carga]) ), [feach_carga])
return
if(isblank(_max), 0, [odometro_carga] - maxx(filter(Table , [economico] = earlier([economico]) && [feach_carga] =_max ), [odometro_carga]) )
Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
@Syndicate_Admin hello good afternoon, I had some problems with the proposed solution, the syntax "BEFORE" does not appear in power bi desktop
I changed it to "EARLIER" and it shows me the following error in the IF
Any idea that is wrong?
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 |
---|---|
113 | |
103 | |
77 | |
67 | |
63 |
User | Count |
---|---|
142 | |
105 | |
102 | |
81 | |
68 |