This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hola
Tengo la tabla mostrada, necesito una medida (1) que calcule la diferencia entre las dos fechas más tempranas
y medir (2) cuántas veces cambió el precio.
Su ayuda es muy apreciada.
Hola @Ashish_Mathur , estoy tratando de implementar su método, pero recibo un error para la medida "Segunda fecha"
Hola
No estoy seguro de cómo se ve su modelo semántico, pero verifique la imagen a continuación y el archivo pbix adjunto.
Función INDEX (DAX) - DAX | Microsoft Learn
latest date value vs. second latest date value: =
VAR _t =
FILTER (
ALL ( 'Calendar'[Date] ),
CALCULATE ( SUM ( Data[Price] ) ) <> BLANK ()
)
VAR _latest =
CALCULATE (
SUM ( Data[Price] ),
INDEX ( 1, _t, ORDERBY ( 'Calendar'[Date], DESC ) )
)
VAR _second =
CALCULATE (
SUM ( Data[Price] ),
INDEX ( 2, _t, ORDERBY ( 'Calendar'[Date], DESC ) )
)
RETURN
IF ( HASONEVALUE ( 'ID'[ID] ), _latest - _second )
Función OFFSET (DAX) - DAX | Microsoft Learn
price change count: =
VAR _nonblankdate =
FILTER (
VALUES ( 'Calendar'[Date] ),
CALCULATE ( SUM ( Data[Price] ) ) <> BLANK ()
)
VAR _t =
FILTER (
ADDCOLUMNS (
SUMMARIZE ( Data, 'Calendar'[Date] ),
"@current", CALCULATE ( SUM ( Data[Price] ) ),
"@prev",
CALCULATE (
SUM ( Data[Price] ),
OFFSET ( -1, _nonblankdate, ORDERBY ( 'Calendar'[Date], ASC ) )
)
),
[@prev] <> BLANK ()
)
RETURN
IF (
HASONEVALUE ( 'ID'[ID] ),
COUNTROWS ( FILTER ( _t, [@current] <> [@prev] ) )
)
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.