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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
LucianoB_
Frequent Visitor

Add a date filter following a Field Parameters slicer selection.

Hi,

 

I have a table with 2 dates and a few measurements:

 

Date 1             Date 2              Measuremente
01/01/202312/01/202210
01/02/202301/01/202323
01/03/202302/01/202345

 

I want a dynamic X-axis, so I created a Field Paramenter with Date 1 and Date 2:

 

Date 1 or Date 2 = {
    ("Date 1", NAMEOF('Table'[Date 1].[Month]), 0),
    ("Date 2", NAMEOF('Table'[Date 2].[Month]), 1)
}
 
Slicer works as expected, however after selecting one of the options (Date 1 or Date 2), I would like the date to show only 2023 and forward.
 
By using the table above it should filter like this:
 
Day 1 selected
Date 1              Date 2              Measuremente
01/01/202312/01/202210
01/02/202301/01/202323
01/03/202302/01/202345

 

Day 2 selected

Date 1                 Date 2                  Measuremente
01/02/202301/01/202323
01/03/202302/01/202345

 

 

Appreciate your help.
1 ACCEPTED SOLUTION
LucianoB_
Frequent Visitor

Thank you all

 

I was able to solve this issue by using the following tutorial.

https://blog.enterprisedna.co/working-with-multiple-dates-in-power-bi/

View solution in original post

3 REPLIES 3
LucianoB_
Frequent Visitor

Thank you all

 

I was able to solve this issue by using the following tutorial.

https://blog.enterprisedna.co/working-with-multiple-dates-in-power-bi/

Anonymous
Not applicable

Hi @LucianoB_ ,

 

You can create a measure as a visual-level filter.

Measure =
SWITCH (
    SELECTEDVALUE ( Parameter[Parameter Fields] ),
    "'Table'[Date 1]", IF ( YEAR ( MAX ( 'Table'[Date 1] ) ) = 2023, 1 ),
    "'Table'[Date 2]", IF ( YEAR ( MAX ( 'Table'[Date 2] ) ) = 2023, 1 )
)

Put this measure into the filters, set up show items when the value is 1.

vstephenmsft_0-1676367303590.png

Here're the results.

vstephenmsft_1-1676367338253.pngvstephenmsft_2-1676367344726.png

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

Thank you so much @Anonymous, I realy appreciate your help.

 

That worked very well with the full date, however I am using Month on the Paramenter Field ('Table'[Date 1].[Month]), and the filter is returning blank.

 

I took your sample file and added a 2nd Parameter:

 

 

Parameter2 = {
    ("[Date 1].[Month]", NAMEOF('Table'[Date 1].[Month]), 0),
    ("[Date 2].[Month]", NAMEOF('Table'[Date 2].[Month]), 1)
}

 

 

 

Here are the results:

LucianoB__2-1676469981583.png

 

 

This is what I am trying to achive:

LucianoB__1-1676469761581.png

 

Thank again for your help.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.