Forum Discussion

Segun's avatar
Segun
Frequent Visitor
8 years ago
Solved

Dynamic date input

Hello ,   I need help in furing out how to write a Dax for dynamic date input. As shown in the table below, I would like to select my input date column usind a slicer E.g  Date of Birth Wedding...
  • v-juanli-msft's avatar
    8 years ago

    Hi Segun 

    Based on my understanding:

    First, you would like to select from three date columns using a slicer,

    Second, users can select from some dates of one column to plot a visual.

     

    For example, I use the following dataset as a test.

     

    First, from “Sheet1”, create three new tables

    Table1 =
    SUMMARIZE ( Sheet1, [Date of Birth], [numnber], [value] )
    Table2 =
    SUMMARIZE ( Sheet1, [Wedding Date], [numnber], [value] )
    Table 3 =
    SUMMARIZE ( Sheet1, [Divorce Date], [numnber], [value] )

     

    Second, create “Date Type” columns in three tables separately.

    In Table1

    Date Type =
    IF ( [Date of Birth] <> BLANK (), "Date of Birth" )

    In Table2

    Date Type =
    IF ( [Wedding Date] <> BLANK (), "Wedding Date" )

     

    In Table3
    Date Type =
    IF ( [Divorce Date] <> BLANK (), "Divorce Date" )

     

    Third, union three new tables and rename column name as you wanted.

    Table 4 =
    UNION ( 'Table1', Table2, 'Table 3' )

     

    Finally, in Report View, we could add columns “Date Type” and “Date” to slicers.

     

    Best Regards

    Maggie