Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Segun
Frequent Visitor

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 Date

Divorce Date

 

And then use the specific date data to build my visualization. The user can then be able to select which of thses dates they want to plot.

 

Thanks,

Dates.JPG

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

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.

1.png

 

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' )

2.png

 

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

3.png

 

Best Regards

Maggie

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

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.

1.png

 

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' )

2.png

 

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

3.png

 

Best Regards

Maggie

Thank you! I really appreciate!

Segun
Frequent Visitor

I'm trying to create a chart with dynamic date input. 

The user would be able to select a date category with a slicer option and the visualization will automatically be populated

The input dates category look like something in the picture below. Thanks for your help.Dates.JPG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.