I'm currently working with Power BI Desktop and SQL Server 2014 on a POC (proof of concept) asked by my superior (long story short, he said that we were able to do what i'm asking without knowing if it was possible or not...).
I'm able to see the result of a stored procedure into Power BI when I create a new data source from SQL Server with an SQL instruction (typed in the advanced options)
Query : Sql.Database("SERVER\INSTANCE", "DatabaseName", [Query="EXECUTE [dbo].[StoredProcedureName]"])
Source : How to use SQL Server stored procedures in Microsoft PowerBI?
I'm also able to display my Windows login using the USERNAME()
DAX formula.
We use a lot of stored procedures that take the windows login as a parameter and I know that USERNAME()
will not return the same value when the Power BI report will be published online, so I'll need to create a table which will allow me to make the correspondence between the Windows login of the user an his/her Power BI account (an email address).
My question is simple : I want to know if I can call a stored procedure with Power BI, using the result of USERNAME()
as a parameter of this stored procedure.
Any help is appreciated, i'm quite stuck at the moment as I didn't use Power BI before...