Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hola a todos,
tengo un problema intentando generar una medida, tengo una tabla con registros de consumo energetico (acumulado), son varias mediciones por dia, si quisiera saber el consumo total del día solo tendria que restar el ultimo registro y el primero del mismo dia
Espero haber sido suficientemente claro y agradezco de antemano el apoyo
| fecha | Acumulado al momento | consumo(esta es la medida que no logro generar) |
| 01/11/2019 0:05:00 | 1,725.91 | |
| 01/11/2019 0:10:00 | 1,725.94 | R=0.03 (1,725.94-1,725.91) |
| 01/11/2019 0:15:00 | 1,725.97 | 0.03 |
| 01/11/2019 0:20:00 | 1,726.00 | 0.03 |
| 01/11/2019 0:25:00 | 1,726.03 | 0.03 |
| 01/11/2019 0:30:00 | 1,726.06 | 0.03 |
| 01/11/2019 0:35:00 | 1,726.09 | 0.03 |
| 01/11/2019 0:40:00 | 1,726.11 | 0.02 |
| 01/11/2019 0:45:00 | 1,726.16 | 0.05 |
| 01/11/2019 0:50:00 | 1,726.19 | 0.03 |
| 01/11/2019 0:55:00 | 1,726.22 | 0.03 |
| 01/11/2019 1:00:00 | 1,726.26 | 0.04 |
| 01/11/2019 1:05:00 | 1,726.30 | 0.04 |
| 01/11/2019 1:10:00 | 1,726.32 | 0.02 |
| 01/11/2019 1:15:00 | 1,726.36 | 0.04 |
Solved! Go to Solution.
Hi @EdgarEstrella ,
If I understand you correctly, please check following measure and see if the result achieve your expectation:
Measure 2 =
VAR a =
CALCULATE (
MAX ( 'Table'[fecha] ),
FILTER (
ALLSELECTED ( 'Table' ),
FORMAT ( 'Table'[fecha], "YYYYMMDD" )
= FORMAT ( MAX ( 'Table'[fecha] ), "YYYYMMDD" )
)
)
VAR b =
CALCULATE (
MIN ( 'Table'[fecha] ),
FILTER (
ALLSELECTED ( 'Table' ),
FORMAT ( 'Table'[fecha], "YYYYMMDD" )
= FORMAT ( MAX ( 'Table'[fecha] ), "YYYYMMDD" )
)
)
VAR c =
CALCULATE (
MAX ( 'Table'[Acumulado al momento] ),
FILTER ( ALL ( 'Table' ), 'Table'[fecha] = a )
)
VAR d =
CALCULATE (
MAX ( 'Table'[Acumulado al momento] ),
FILTER ( ALL ( 'Table' ), 'Table'[fecha] = b )
)
RETURN
c - dResult would be shown as below:
If I misunderstood your meaning, please let me know.
BTW, Pbix as attached, hopefully works for you.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @EdgarEstrella ,
If I understand you correctly, please check following measure and see if the result achieve your expectation:
Measure 2 =
VAR a =
CALCULATE (
MAX ( 'Table'[fecha] ),
FILTER (
ALLSELECTED ( 'Table' ),
FORMAT ( 'Table'[fecha], "YYYYMMDD" )
= FORMAT ( MAX ( 'Table'[fecha] ), "YYYYMMDD" )
)
)
VAR b =
CALCULATE (
MIN ( 'Table'[fecha] ),
FILTER (
ALLSELECTED ( 'Table' ),
FORMAT ( 'Table'[fecha], "YYYYMMDD" )
= FORMAT ( MAX ( 'Table'[fecha] ), "YYYYMMDD" )
)
)
VAR c =
CALCULATE (
MAX ( 'Table'[Acumulado al momento] ),
FILTER ( ALL ( 'Table' ), 'Table'[fecha] = a )
)
VAR d =
CALCULATE (
MAX ( 'Table'[Acumulado al momento] ),
FILTER ( ALL ( 'Table' ), 'Table'[fecha] = b )
)
RETURN
c - dResult would be shown as below:
If I misunderstood your meaning, please let me know.
BTW, Pbix as attached, hopefully works for you.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello I am trying to to the same operation but it does not works, for example I need to display current value- previous value like the picture that I send you, what is wrong?
Buenos días, queria consultar sobre la solución de este tema, ya que estoy trabajando con un problema similar.
Te agardezco si puedes resubir el .PBIX para poder resolver este problema.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 21 | |
| 17 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 51 | |
| 40 | |
| 30 | |
| 24 |