Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I have a data slicer in my report and I want to create a measure that will subtract the value at end of the date filter from the value at the start data selected
for example if i set my date slicer to between 4-20 - 4-24 I want the value to show 40 (120-80)
Date Value
4-20 120
4-21 110
4-22 100
4-23 90
4-24 80
Thank you!
Solved! Go to Solution.
hI @Anonymous ,
Try this measure:
hI @Anonymous ,
Try this measure:
Hi @Anonymous
try a measure
Measure =
var _minDate = MIN('Table'[Date])
var _maxDate = MAX('Table'[Date])
return
MAXX(FILTER('Table','Table'[Date]=_maxDate),'Table'[Amount]) -
MAXX(FILTER('Table','Table'[Date]=_minDate),'Table'[Amount])
@Anonymous , prefer to use a date calendar for dates
Try like
Measure =
var _min = minx('Date','Date'[Date])
var _max = maxx('Date','Date'[Date])
return
calculate(Table[Value],filter('Date','Date'[Date]=_min))- calculate(Table[Value],filter('Date','Date'[Date]=_max))
Or
Measure =
var _min = minx('Date','Date'[Date])
var _max = maxx('Date','Date'[Date])
return
calculate(Table[Value],filter(all('Date'),'Date'[Date]=_min))- calculate(Table[Value],filter(all('Date'),'Date'[Date]=_max))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 46 | |
| 31 | |
| 29 | |
| 15 | |
| 15 |
| User | Count |
|---|---|
| 58 | |
| 56 | |
| 38 | |
| 21 | |
| 21 |