I have a table that contains data for 13 prior month ends as well as the most recent business day. The majority of my reports only look at a single period at a time so I have a slicer on each report to allow the user to choose the period they want to look at, which is generally the most recent business day. Whenever the data gets refreshed I have to manually go to each slicer that had the most recent business day selected and choose the new most recent business day (unfortunately my organization hasn't updated to the version that allows the slicers to be synced). As we move towards production and scheduled refreshes, this will be a nuisance so I added a second column called REPORTING_DATE, which is equal to the original DATA_DATE field except the most recent date is replaced with 'Most Recent' so any slicers with that selected can maintain their selection after a refresh.
This is a simplified example of my data:
DATA_DATE REPORTING_DATE ACCOUNT_NO
7/10/2018 Most Recent 1001
7/10/2018 Most Recent 1002
7/10/2018 Most Recent 1003
7/10/2018 Most Recent 1004
7/10/2018 Most Recent 1005
7/10/2018 Most Recent 1006
7/10/2018 Most Recent 1007
6/30/2018 6/30/2018 1001
6/30/2018 6/30/2018 1002
6/30/2018 6/30/2018 1003
6/30/2018 6/30/2018 1004
6/30/2018 6/30/2018 1005
6/30/2018 6/30/2018 1006
5/31/2018 5/31/2018 1001
5/31/2018 5/31/2018 1002
5/31/2018 5/31/2018 1003
5/31/2018 5/31/2018 1004
My issue is that when I change my slicer to use DATA_DATE instead of REPORTING_DATE it breaks my measure that I use to calculate the change in counts for each period.
Change in Count (Month) = DISTINCTCOUNT(MyData[ACCOUNT_NO])-CALCULATE(DISTINCTCOUNT(MyData[ACOUNT_NO]),PARALLELPERIOD(MyData[DATA_DATE],-1,MONTH))
When my slicer has DATA_DATE = 7/10/2018
the measure correctly returns 1 (count of 7 for July 10 minus a count of 6 for June 30). When I use a slicer with REPORTING_DATE = Most Recent
I get 7 because DISTINCTCOUNT(MyData[ACCOUNT_NO])
returns 7, which is correct, but CALCULATE(DISTINCTCOUNT(MyData[ACOUNT_NO]),PARALLELPERIOD(MyData[DATA_DATE],-1,MONTH))
returns (Blank)
. It looks like PARALLELPERIOD(MyData[DATA_DATE],-1,MONTH)
returns the same value 6/30/2018
regardless of the slicer being used so I'm stumped as to the issue.