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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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. 

 

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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