Set DAX Parameters

Hello,

I have the following requirement from a client and would like to have opinions on the feasability of it.
In an existing report, the client would like to add a date slicer on the page appearing as a date picker to select a single date. The slicer is using the date field of a date table.

There are several table visuals on the report ( yes I know Visualisation wise they are not there yet :slight_smile: ) and all of them are using the date from the date table as well.

Because when working with the slicer you can only choose ‘‘date before’’ or ‘‘date after’’ and not ‘‘date equal to’’ , we would like to develop a parameter to use at the visual level.
The goal of the parameter would be to return in the table only the date selected by the date picker.

For instance, as in my attached example we would select october 20th, I only want this date in my table - see “table- expected results”.

I understand that there is no major benefit to leave the date field with the tables but the client want to keep it that way in case data is exported to excel(aaaah…).

Thank you,
31102022.pbix (72.7 KB)

Hello @Cedric,

Thank You for posting your query onto the Forum.

In order to achieve the results based on the scenario that you’ve metioned. Below is the DAX measure alongwith the screenshot of the final results provided for the reference -

Total Sales As On Selected Date = 
VAR _Selected_Date = 
CALCULATE( MIN( Dates[Date] ) , 
    ALLSELECTED( Dates[Date] ) )

VAR _Results = 
CALCULATE( SUM( Data[Amount] ) , 
    KEEPFILTERS( Dates[Date] = _Selected_Date ) )

RETURN
_Results

I’m also attaching the working of the PBIX file for the reference purposes.

Hoping you find this useful and meets your requirements that you’ve been looking for.

Thanks and Warm Regards,
Harsh

Sales As On Selected Date - Harsh.pbix (60.9 KB)