Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 217817

Using the displayed date slicer for measure

$
0
0

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 NameNumber of unitsDemand MonthGeo
12/1/201616/1/2017US
12/1/201627/1/2017US
    
12/1/201649/1/2017US
1/1/201746/1/2017US
1/1/201767/1/2017US
1/1/201788/1/2017US
1/1/201759/1/2017US

 

I would like something like this: 

ComparisionDemand MonthDifferenceGeo
Dec vs. Jan6/1/20173US
Dec vs. Jan7/1/20174US
Dec vs. Jan8/1/20178US
Dec vs. Jan9/1/20171US

 

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,

 


Viewing all articles
Browse latest Browse all 217817

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>