Forum Discussion
Single date input in Power BI
Hi,
I am trying to convert a spotfire dashboard to Power BI. We have a input field in Spotfire which takes datetime as the filter value so users type the required date in the input field then there is a calculation happens based on the date entered by the user. I need to do the same thing in Power BI but here the slicer does not take single date as an input so how to solve this issue?
Please let me know your solution
Ritaf1983 amitchandak rohit1991 danextian burakkaragoz Akash_Varuna FBergamaschi Elena_Kalina Ashish_Mathur pankajnamekar25 mark_endicott
Hi vivek_babu
Power BI doesn't currently support single date selection unless you're using a dropdown or tile slicer. My usual workaround is to use a before option of the range slicer, a shape and a text box. The shape and textbox cover the min date of the slicer. They're then grouped and I ensure that maintain layer order is enabled for those three visuals
Hi vivek_babu
To meet your goal allowing users to pick a single date easily (not from a scrollable range slicer), but through search or direct input you can use a slicer with dropdown
Try this below steps :
- Add your date field to a slicer.
- In the slicer settings >> slicer visual>> More options.
- Choose “Dropdown” instead of “Between” or “List”. Click on the slicer where the dates are shown on your report.
Reference : https://databear.com/power-bi-on-screen-date-picker-no-custom-visual/
https://www.youtube.com/watch?v=zhWtU0DynCk&t=585sHope this helps !!
Thank You..Hmm, interesting. Is it possible for you to provide us with a sample scenario a PBIX file or a screenshot using some dummy data that you're facing the issue with? Also, have you used the TREATAS function in your scenario, like in Patrick's video? It seems that this function helps perform calculations for that specific date
22 Replies
- FBergamaschiSuper User
Power BI can only wirk on tables, so you must create a list of all the dates and create a slicer on that
You already have a calendar table?
- vivek_babuHelper II
Hi FBergamaschi ,
Thanks for quick response.
Yes i have a date table and if i use this in slicer then it provides me the between range like start and end date which i dont need. I need single date selection by the user not the date rangeRegards
- FBergamaschiSuper User
The user will have to do a selection on those dates, or am I missing what you are trying to do. How does yhe user selects the date? Does this happen outside Power BI? Is this selected date available in a table?
- vivek_babuHelper II
Hi FBergamaschi ,
It is a input field in spotfire like a what if parameter in power bi. Users will type the required date in that field and that date is fetched and used in the calculations.
Regards
- danextianSuper User
Hi vivek_babu
Power BI doesn't currently support single date selection unless you're using a dropdown or tile slicer. My usual workaround is to use a before option of the range slicer, a shape and a text box. The shape and textbox cover the min date of the slicer. They're then grouped and I ensure that maintain layer order is enabled for those three visuals
- vivek_babuHelper II
Hi danextian
Thanks for the response. I tried this after and before approach but i need the selected date alone. Example if i pick 7/30/2025 and i use selectedvalue function then it needs to return the exact date. This is not happening with min or max approach.
Regards
- vivek_babuHelper II
Hi danextian
I tried using patrick's approach. I used After style option in the slicer and then created measure like this,
DatePick =
var _selecteddate = MIN('Calendar Table'[Date])RETURN_selecteddate
This works and it provides me the date that is selected in the slicer. Thanks for your helpRegards
- kushanNaSuper User
hi vivek_babu
Have you checked Patrick's Single date picker method to see if it works for you?
https://www.youtube.com/watch?v=zhWtU0DynCk&ab_channel=GuyinaCube- vivek_babuHelper II
Hi kushanNa
Thanks for the response. I tried this after and before approach but i need the selected date alone. Example if i pick 7/30/2025 and i use selectedvalue function then it needs to return the exact date. This is not happening with min or max approach.
Regards
- kushanNaSuper User
Hmm, interesting. Is it possible for you to provide us with a sample scenario a PBIX file or a screenshot using some dummy data that you're facing the issue with? Also, have you used the TREATAS function in your scenario, like in Patrick's video? It seems that this function helps perform calculations for that specific date
- kurrysamirHelper I
HI All,
I am working on a similar single date picker requirement where users want to select a date using a date picker. I am using direct query instead of Import mode. Each and every time the user selects a date, there is a stored procedure executes that has a date parameter and gets the data for that single date. Please correct my understanding here, the single date picker would work just with Import mode and not with a Direct Query?
- v-aatheequeCommunity Support
Hi kurrysamir
A single date slicer works in both Import and DirectQuery modes. The difference is how the data is handled when the date changes.- Import mode:
Data is already loaded into Power BI. Selecting a date simply filters the cached data no new query is sent to the database. - DirectQuery mode:
Data stays in the source. Each date selection sends a new query to the database with the date filter applied.
In DirectQuery sends a query (or executes your stored procedure) each time.If your requirement is that every date selection must call a stored procedure with that date, then DirectQuery is the right choice. Import mode won’t do that because it doesn’t re-query the database after the initial load.
- kurrysamirHelper I
Thank you for replying. I am following this thread in Power BI - Single Date Picker without DAX - Microsoft Fabric Community. Checked the youtube video, implemented the single date time picker. On selection of different dates, I am unable to pass the selected date paramterer to the function(its not a stored procedure, my bad for this). I have made a relationshop as 1..* from DateDimension table =
CALENDAR(DATE(2022,01,01), TODAY()-1) that follows a date hierarchy to the date column in the function. Any tutorial or link that I could follow, would be helpful.
- Import mode: