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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
mahmoud_kfawzy
Frequent Visitor

How to take date as a user input and run the query according to it?

I have a live oracle DB connected to Power Bi refreching every hour always showing the stats of today:

 

Query goes something like that

"where date >= sysdate"

 

Now I want to be able to show specefic dates in the past.

 

How I do it right now:

* Remove the where clause and select all dates in the query

* Show a slicer with every date there is and let the user choose it and dsiplay it

(This methid is very slow and takes a lot of time to load with "select *")

 

Is there a methid where user enters for example "2021-12-28", and then it'd automatically query:

"where date == '2021-12-28'"

And load this specefic date?

 

Thank you.

1 REPLY 1
AllisonKennedy
Super User
Super User

@mahmoud_kfawzy  this might help: https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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