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

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

Reply
markyochoa
Helper I
Helper I

How to use custom date picker to filter in visual

For alot of my dashboards I've been using a custom date picker as a way to do relative date calculations, as is best practice. 

 

So I do have a separate table that has all dates spanning across several years. Up until now it hasn't been a problem.

 

The problem I have no is, how do I use this to filter a table. e.g.

Year Picker (which is just YEAR(DateSelector[Date]))

Year
2022
2023

 

Actual Table

Date CreatedColumnA
1/1/2022X
1/1/2023Y

 

Previously I just had the "Date Created" field in the filters pane and had it filtering only 2022. But now I need to be able to toggle between last year and this year, while also using the custom date picker. 

 

I tried various ways to do this like creating a column:

 

inSelectedYear = YEAR([Date Created]) == YEAR(MIN(DateSelector[Date]))

 

And try to have that as a boolean filter for True values but it doesn't work. I'm assuming this is a row level problem? Where it will always be true just by how powerbi handles these types of things?

 

Any help would be appreciated. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @markyochoa ,

I created a sample pbix file(see the attachment), please check if that is what you want. And assume that there is no relationship created between the table DateSelector and actual.... 

1. Create a slicer using the field YEAR(DateSelector[Date])

yingyinr_3-1672900111373.png

2. Create a measure as below to judge if the year of [Date Created] is equal to the selected year of DateSelector[Date]

Flag = 
VAR _selyears =
    ALLSELECTED ( 'DateSelector'[Year] )
VAR _seldate =
    SELECTEDVALUE ( 'Actual'[Date Created] )
RETURN
    IF ( YEAR ( _seldate ) IN _selyears, 1, 0 )

3. Create a table visual and apply a visual-level filter with the condition(Flag is 1)

yingyinr_1-1672900029603.png

If the above one can't help you get the desired result, please provide more raw data in your actual table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @markyochoa ,

I created a sample pbix file(see the attachment), please check if that is what you want. And assume that there is no relationship created between the table DateSelector and actual.... 

1. Create a slicer using the field YEAR(DateSelector[Date])

yingyinr_3-1672900111373.png

2. Create a measure as below to judge if the year of [Date Created] is equal to the selected year of DateSelector[Date]

Flag = 
VAR _selyears =
    ALLSELECTED ( 'DateSelector'[Year] )
VAR _seldate =
    SELECTEDVALUE ( 'Actual'[Date Created] )
RETURN
    IF ( YEAR ( _seldate ) IN _selyears, 1, 0 )

3. Create a table visual and apply a visual-level filter with the condition(Flag is 1)

yingyinr_1-1672900029603.png

If the above one can't help you get the desired result, please provide more raw data in your actual table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Thanks! That worked!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.