Forum Discussion
Anonymous
6 years agoNot applicable
$ Difference between MIN and MAX dates
Hello, I am trying to create a card showing the difference in ACV between the MAX date and the MIN date. This is tied to a date filter on a bar graph, so when the user switches years on the graph, th...
- 6 years ago
Anonymous
Try like
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)))
Greg_Deckler
Community Champion
6 years agoSee if this works: https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/td-p/985814