Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

$ Diferencia entre las fechas MIN y MAX

Hola, estoy tratando de crear una tarjeta que muestre la diferencia en ACV entre la fecha MAX y la fecha MIN. Esto está vinculado a un filtro de fecha en un gráfico de barras, por lo que cuando el usuario cambia años en el gráfico, la tarjeta reflejará el cambio $ en ACV y % de cambio (es decir, para otra tarjeta más adelante) para el nuevo rango de años. Por lo tanto, una simple calque de resta entre el primer año y el año pasado seleccionado es lo que estoy buscando para el cambio $.

Sin embargo, ¡no puedo hacer que funcione! Aquí están los datos de muestra con los que estoy trabajando:

añoCategoría de productoAcv
2011A$131,282.70
2012A$1,397,633.70
2013A$2,472,531.60
2014A$4,010,372.20
2015A$5,295,672.70
2016A$6,553,524.60

Tengo una mesa de citas en su lugar. Intenté varias cosas publicadas antes, pero no estoy llegando a ninguna parte. Por ejemplo, estoy intentando restar el ACV de 2012 del ACV para 2014 para mostrar el cambio total en el tiempo (por lo que no contar 2013). No estoy recibiendo el valor correcto de aproximadamente $2.6m

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@cbtekrony

Trate como

measure =
var _max = maxx('Date','Date'[Date])
var _min = Minx('Date','Date'[Date])
return
CALCULATE(SUM(Table[ACV]), FILTER(all('Date'), 'Date'[Date] =_max)) -CALCULATE(SUM(Table[ACV]), FILTER(all('Date'), 'Date'[Date] =_min))
/////////////////////////////////Or

measure =
var _max = maxx('Date','Date'[Date])
var _min = Minx('Date','Date'[Date])
return
CALCULATE(SUM(Table[ACV]), FILTER(all('Date'), year('Date'[Date]) =year(_max))) -CALCULATE(SUM(Table[ACV]), FILTER(all('Date'), year('Date'[Date]) =year(_min)))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hola @cbtekrony

Puede probar la lógica como se muestra a continuación:

Measure = 
var _minyear=MIN('Table'[Year]) 
var _maxyear=MAX('Table'[Year])
return
CALCULATE(SUM('Table'[ACV]),FILTER(ALLEXCEPT('Table','Table'[Product Category]),'Table'[Year]=_maxyear))-CALCULATE(SUM('Table'[ACV]),FILTER(ALLEXCEPT('Table','Table'[Product Category]),'Table'[Year]=_minyear))
Measure 2 = 
var _minyear=MIN('Table'[Year]) 
var _maxyear=MAX('Table'[Year])
return
CALCULATE(SUM('Table'[ACV]),FILTER('Table','Table'[Year]=_maxyear))-CALCULATE(SUM('Table'[ACV]),FILTER('Table','Table'[Year]=_minyear))

Resultado:

2.JPG

saludos

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
Community Champion

Mira si esto funciona: https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/td-p/985814



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@cbtekrony

Trate como

measure =
var _max = maxx('Date','Date'[Date])
var _min = Minx('Date','Date'[Date])
return
CALCULATE(SUM(Table[ACV]), FILTER(all('Date'), 'Date'[Date] =_max)) -CALCULATE(SUM(Table[ACV]), FILTER(all('Date'), 'Date'[Date] =_min))
/////////////////////////////////Or

measure =
var _max = maxx('Date','Date'[Date])
var _min = Minx('Date','Date'[Date])
return
CALCULATE(SUM(Table[ACV]), FILTER(all('Date'), year('Date'[Date]) =year(_max))) -CALCULATE(SUM(Table[ACV]), FILTER(all('Date'), year('Date'[Date]) =year(_min)))
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.