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
Anonymous
Not applicable

How to filter based on an input date

Hello,

 

I would like to filter my data based on a date input. Create a slider like to determine a day in the month and use that value inside of measures.

How could I create that (the input & the ""variable"") ?

 

Thanks for your help

6 REPLIES 6
Greg_Deckler
Community Champion
Community Champion

@Anonymous You would put a Date column into a Slicer visual. I believe that this is going to default to a slider where you can select a start and end time but you can change this using the little down caret icon in the upper right. Then, you can use this DAX to get the date/dates:

VAR __Min = MIN('Dates'[Date])

VAR __Max = MAX('Dates'[Date])



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thank you for the answer @Greg_Deckler .

 

I am trying to apply this solution, created a new table and added dummy dates inside of a column.

 

Here is the dax query that I am then using in order to try to filter the date:

 

currentMonthPunchedHours = CALCULATE(sum(punches[hours]), and(True, and(YEAR(punches[punchIn]) * 12 + MONTH(punches[punchIn]) = YEAR(TODAY()) * 12 + MONTH(TODAY()), and(YEAR(punches[punchOut]) * 12 + MONTH(punches[punchOut]) = YEAR(TODAY()) * 12 + MONTH(TODAY()), DAY('measure stuff'[breakEnd]) > DAY(punches[punchIn])))))
 
I am getting the error 'a function "placeholder" has been used in a True/False expression that is sued as a table filter expression. This is not allowed'.
 
In the dax query above, punchIn is the date to be filtered on, and breakEnd is "Max..." as mentionned in your answer.
 
Thanks for the help.
Jeanxyz
Impactful Individual
Impactful Individual

Do you have a column called 'input date' in the input table? If that's the case, you can create a dim_calendar table and link the input table to dim_calendar table based on relationship dim_calendar [date] - fact_input[input date]. 

 

You can then add a slicer to the visual, drag and drop dim_calendar[date] to the slicer. 

 

pbix sample: https://www.dropbox.com/s/8nzzp6mxlt4871x/filter%20test.pbix?dl=0

Anonymous
Not applicable

I do have 2 dates columns that I want to filter, but I want to filter both of them but only the day.

Would there be any way to do it ?

Jeanxyz
Impactful Individual
Impactful Individual

@fzpokg, Are both columns in the same table?  It's not a typical solution, but you can link both date columns to dim_calendar table, but Power BI only allows one active relationship, the other one will be inactive. You can enable the inactive relationship via userelationship(). 

 

Here is DAX guide on userelationship()

https://dax.guide/userelationship/

 

 

 

Anonymous
Not applicable

Both are in the same Table, but I would like to be able to use the day number to filter on another table.

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.