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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Pass Filter value form Power BI to SQL and in result get the data from SQL and update it in report.

Hello All,

Getting data from sql by querly like: 

select * from [dbo].[OrderByDate]('2019-05-01')  

For Report Date Filter Created DAX calender.

 

Report Date = 
ADDCOLUMNS ( CALENDAR (DATE(2016,1,1),
DATE(2020,12,31)), "DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ),
"Year", YEAR ( [Date] ), "YearMonthnumber", FORMAT ( [Date], "YYYY/MM" ),
"Month Year", FORMAT ( [Date], "mmm/YYYY" ) )  

Create filter of date in UI and want to pass the selected Date value to SQL,
And in result get the Calculated data from SQL.

At SQL side lots of columns data updated based on Date pass. so that all data should be updated in report and Dashboard by Changing Report Date selection.

Check below image of sample, based on date selection it dispalyed status of it.
Report use for daily status report, and perticuler days status.
But here data displayed for selected date query in the SQL (Static values). 
how to change it to dynamic filter.

123.png

 

 

 

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Not very clear. You can use the slicers and make it dynamic. 

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak 
Report Date is the User input. 

Getting data using Direct Query, in that query Date pass to SQL, and there are lots of calculation at SQL side and in the result it gives calculated data. 

I tried to do one fo the calculation from it at Power BI but unable to develop in DAX.
https://community.powerbi.com/t5/Desktop/Create-Dynamic-Column-based-on-date-filter-is-not-working/m...

So I want to pass the selected Date from POWER BI filter to SQL to get the data. 
If date is 01-05-2020 then all data is related to this date. 
Now User select date 05-05-2020 then data is different. 

So how can I pass the date filter value into SQL and get data from there.
My question is Similar to: 

Hi @Anonymous ,

 

Refer to this thread:

https://community.powerbi.com/t5/Desktop/Slicer-Value-as-a-parameter-to-stored-procedure/td-p/220397 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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