The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hola Todos,
Tengo el siguiente problema, necesito buscar la diferencia entre dos numeros (kilometros) ubicados en la misma columna y sumar su diferencia a final de mes.
El problema principal es que la tabla tiene distintos TP_CODBEM y se informan en distintas fechas, por lo que aveces los kilometrajes no estan en orden, como se evidencia en la tabla
Agradeceria me ayudaran con una funcion que me ayude a solucionar.
@Daniels2204 , Try like
value = [TP_POS_CONT] - maxx(filter(table, table[TP_CODBEM] = earlier([TP_CODBEM]) && table[TP_DTORIGI] = earlier([TP_DTORIGI]) && table[TP_POS_CONT] < earlier([TP_POS_CONT])),[TP_POS_CONT])
Hi, @amitchandak
Forget to comment that the table is in Directquery mod and I found that MAXX is not compatible.
Thank You, @amitchandak
But when writing the formula as is, it generates the error with "="
Then, corrected the error showed up to "FILTER"
I wait for comments,
Cheers,
So for each TP_CODBEM you need to find the smallest and largest odometer reading and get the difference, right?
Hi, @lbendlin
I need for each TP_CODBEM to find the kilometers traveled for each month, subtracting the kilometers from each other and adding their result
User | Count |
---|---|
27 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
31 | |
15 | |
12 | |
7 | |
6 |