Filter data card measures using date slicer

Hi learned brethren,
I have 3 sets of 2 data cards.
One set (High) has a card for sum of 2019 values, and the other is sum of 2018 (or LY) values. This latter one uses SAMEPERIODLASTYEAR function.
Then 2 more sets (Med) and (Low) …. again each of these sets contain 2019/2018 (or LY) values.
What I’m trying to achieve is to use a date slicer, that when changed, also changes each set of high/med/low data cards. eg. changing the date slicer will change the values for each category of 2019 and 2018 (LY) cards.

Hope this makes sense.
TIA John

Hi @jmaikido

Request you to please share the sample PBIX file to analyse and provide solution.

Regards,
Ankit

Hey Ankit,

Thnx for your interest. I am unable to send thru a (.pbix) but have attached a snapshot of the 3 sets of measures. Also a txt file with an example of the HIGH set of measures.

Again … I wish to use the date slicer to affect measure values when the date range changes.
The date slicer uses the Vulnerability_Discovery_Date column of the Vulnerability (2) table.PBI DAX Measures.txt (435 Bytes)

Hi @jmaikido

First, do you have a Calendar table in your model. It’s always best to have Calendar table to get consistent results. Please see below video on how to create custom calendar table.

Secondly, pls confirm on the requirement . In Slicer, you are selecting date range from Aug’18 to Nov’19. So, is it as below?

High 2018, data required from 14 Aug 18 to 31st Dec 18
High 2019, data required from 1st Jan 2019 to 11th July 2019

Thanks,
Ankit Jain

Hi Ankit,

Yes I have date table, which I can use.

The dates on the slicer are based on the dates mix/max covering the data. They were not manually selected. Again, if I select a different date range (from the slicer), I want the measures to change accordingly.

Thanks, John

Hi jmaikido - Based on your problem statement, you can try something like below.

Using Date Table:
Sales_2018 = CALCULATE ( [Total Sales], FILTER ( Dates, Dates[Year] = 2018 ) )
Using Fact Table:
Sales_2018_Fact =
CALCULATE ( [Total Sales], FILTER ( Sales, YEAR ( Sales[OrderDate] ) = 2018 ) )

Above will give the value for Year 2018 and will change based on dates selected in Slicer. If no date is Selected for 2018, it will give blank.Do check if it solves your problem else clarify more on the requirement.

Thanks
Ankit Jain

Hi @jmaikido, we’ve noticed that no response has been received from you since December 19, 2019. We just want to check if you still need further help with this post? In case there won’t be any activity on it in the next few days, we’ll be tagging this post as Solved. You may reopen a new thread when the need arises.

Hi E-DNA … I’m not back at work until Jan 06 … so can this case please remain open for the short-term?