Forum Discussion
Finding the difference between two amounts within a slicer range
- 8 years ago
Hi,
Try this
=CALCULATE(SUM(your_measure),FILTER(Data,Data[snapshotdate]=MAX(calendar[date])))-
CALCULATE(SUM(your_measure),FILTER(Data,Data[snapshotdate]=MIN(calendar[date])))
Ensure the following:
1. There is a calendar table
2. There should be a relationship from the Snapshotdate in the Data table to the Date column in your calendar table
3. In the KPI visual, drag the date from the calendar table
4. The slicer should be built from the Date column of the calendar table
Hope this helps.
Hello Ashish, thank you for the reply.
I think the issue is that the numbers represented in the "Count" aren't always greater than the previous. So I could have a MIN that would be half way down the list but I would need to pull the related "Count" value associated with the first date.
I may be misunderstanding your answer also. I need the value of "Count" associated with the MIN date and MAX date (those are the two numbers I need to do calculation on). Those dates are dependent on a slicer. The numbers in the column are also a SUM, the above column is the "see data" when I look at the KPI visual.
Hi,
Try this
=CALCULATE(SUM(your_measure),FILTER(Data,Data[snapshotdate]=MAX(calendar[date])))-
CALCULATE(SUM(your_measure),FILTER(Data,Data[snapshotdate]=MIN(calendar[date])))
Ensure the following:
1. There is a calendar table
2. There should be a relationship from the Snapshotdate in the Data table to the Date column in your calendar table
3. In the KPI visual, drag the date from the calendar table
4. The slicer should be built from the Date column of the calendar table
Hope this helps.
- jeremy_R_b8 years agoFrequent Visitor
Thanks Ashish, this seemed to work. I was having a comparison error but I realized I was using two different types of data for 'Data[snapshotdate]' and 'MAX(calendar[date])'.
Appreciate it!
Anonymous I appreciate the additional help, I'll keep it in mind!