Forum Discussion
Date Difference Calculation with what if parameters
Hello,
I am trying to calculate totals based on a what if parameter that filters by days selected within the "what if" parameter.
Therefore as per the below picture, I have selected March 11 2020 and would like to calculate totals from 12-13 march 2020 (+2 days in the what if parameter)
Days_comparison =
var incidents = [Count of incidents]
var comparison = Days[Date_difference]
var _date = min('Alex Date Period Flow'[Date])
var date_range = comparison + _date
return date_range
Anonymous , if you select a date and you need data more than data you need to have slicer on independent date
//Date1 is independent Date table, Date is joined with Table
new measure =
var _max1 = maxx(allselected(Date1),Date1[Date])
var _min = _max1var _max =_max1 + [What if meausre]
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))
2 Replies
- amitchandak
Super User
Anonymous , if you select a date and you need data more than data you need to have slicer on independent date
//Date1 is independent Date table, Date is joined with Table
new measure =
var _max1 = maxx(allselected(Date1),Date1[Date])
var _min = _max1var _max =_max1 + [What if meausre]
return
calculate( sum(Table[Value]), filter('Date', 'Date'[Date] >=_min && 'Date'[Date] <=_max))- AnonymousNot applicable
Spot on amitchandak , thank you for your help!