Hello All,
First time posting. I would greatly appreciate some help.
TL;DR
How can I have my measure select the displayed snapshotDate in the slicer instead of using the local max in it's dataset?
The data and context:
I want to compare a sales plan made in Dec vs. a new one made now.
I have this dataset:
Snapshot Name | Number of units | Demand Month | Geo |
12/1/2016 | 1 | 6/1/2017 | US |
12/1/2016 | 2 | 7/1/2017 | US |
12/1/2016 | 4 | 9/1/2017 | US |
1/1/2017 | 4 | 6/1/2017 | US |
1/1/2017 | 6 | 7/1/2017 | US |
1/1/2017 | 8 | 8/1/2017 | US |
1/1/2017 | 5 | 9/1/2017 | US |
I would like something like this:
Comparision | Demand Month | Difference | Geo |
Dec vs. Jan | 6/1/2017 | 3 | US |
Dec vs. Jan | 7/1/2017 | 4 | US |
Dec vs. Jan | 8/1/2017 | 8 | US |
Dec vs. Jan | 9/1/2017 | 1 | US |
My formula:
RacksDelta = CALCULATE(SUM(Table[Plan_NumberOfUnits]),FILTER(Table,Table[snapshotDate]=MAX(Table[snapshotDate])))-CALCULATE(SUM(Table[Plan_NumberOfUnits]),FILTER(Table,Table[snapshotDate]=MIN(Table[snapshotDate])))
This equation works whenever I have data in the snapshot, but as seen above sometimes one dataset has values, but the other does not. Since there isn't a value in the real max snapshot date the max value is actually the same as the min since the dataset only contains {min} entries.
Thanks so much all,