Forum Discussion
JBI
7 years agoFrequent Visitor
Difference Between Oldest and Latest Value
Good Day, I have a very simple problem that I can not solve. I simply want to get the difference between the most recent and the oldest value in a table (as Delta). I want to use the most recent ...
- 7 years ago
You should be able to calculate it with something along the lines of:
min PLS = VAR minDate = Calculate(MIN(claendar[{date]) , allselected(calendar)) return Calculate( sum([amount]) , calendar[date] = minDate )
tex628
7 years agoCommunity Champion
The issue is with the PLS formulas. The only produce a value if the date calendar is filtered to the flagged date. Which it will never be in a card or in a total.
Add another option in your if statement that checks if
SELECTEDVALUE('Calendar'[Date]) = BLANK()
This should return true if calculated where there is no date dimension filtering.
JBI
7 years agoFrequent Visitor
Hi tex628,
SELECTEDVALUE doesn't work since it requires a column as a parameter and in my example the flag is created by a measure.
Do you know how to solve this problem without using measures to flag which two columns to use?
Thanks!
- tex6287 years agoCommunity Champion
You should be able to calculate it with something along the lines of:
min PLS = VAR minDate = Calculate(MIN(claendar[{date]) , allselected(calendar)) return Calculate( sum([amount]) , calendar[date] = minDate )