Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
My IT associate and I recently configured a Direct Query in Power BI that leverages a SQL Function with parameterized Start and End Dates for my Reports. I've received authorization to bypass the SQL Function and execute queries directly from within Power Querys Advanced Editor. Hopfully, I can configure this to operate in import mode as I have more data cleansing operations I need done. I am encountering challenges in locating the appropriate syntax for inserting the date parameters within the advanced editor.
In the first Image I have the Function I currently use.
In the second is the Statement the function uses.
Your guidance on this matter would be greatly appreciatted!
Solved! Go to Solution.
Sorry for the late reply. Hopefully you managed to figure it out, but if not then you need to go into the Model view, then bind the column to a parameter. Please note that this will only work in you have Direct Query connection. And ONLY Direct Query. If you have a mix of SharePoint, or anything else, it won't be available.
@peterg0417
I was able to get the Paramaters to work with the following before the Query
StartDate = Text.From ( StartDateParam ),
EndDate = Text.From ( EndDateParam ),
& this in it
WHERE (h.Date_Entered_dt >= N'" & @StartDate & "' and h.Date_Entered_dt <= N'" & @EndDate & "' )
This is great! How can my Start date and End Date Slicers update those paramaters like they do with the Direct Query?
Sorry for the late reply. Hopefully you managed to figure it out, but if not then you need to go into the Model view, then bind the column to a parameter. Please note that this will only work in you have Direct Query connection. And ONLY Direct Query. If you have a mix of SharePoint, or anything else, it won't be available.
Try without the @
That's how I have it in one of my queries.
edit: Oh, and StartDate and EndDate are separate parameters:
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
13 | |
13 | |
11 | |
8 | |
8 |
User | Count |
---|---|
17 | |
10 | |
7 | |
7 | |
7 |