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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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