Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I have the need to support pre-filtering in Power BI in SharePoint Online.
On-premise, I built a web part that accepted web part parameters ‘Filter Table’, ‘Filter Column’ and ‘Filter Value’, which we preset for our customers – allowing us to have one pbix that can be used for several projects, by pre-filtering on a specific project.
The SPO Power BI web part does not support persistent filtering in the web part, nor URL filtering – and so we would be forced to use a separate pbix file for each project (for example).
Do you know of a custom SPFx Power BI web part that I could use or modify to achieve my goal?
Solved! Go to Solution.
Answering my own post. Yes I have implemented a custom spfx web part that does the filtering as described in the original question. There are several resources that pointed me in the right direction.
https://www.youtube.com/watch?v=OcYHf3s_qH0 by Critical Path Training
Connect to API secured with Azure Active Directory (Azure AD) | Microsoft Docs
google "spfx power bi" for more.
Following the MS instructions produces a "user owns data" web part, so each user must have access to the workspace.
Other considerations still to test - 1) guest users, and 2) do I need an 'app owns data' version, where we use a master user's credentials, so that customers do not need a Power BI license.
UPDATE: 1) works for guest users as long as they have access to the workspace and they have a power bi (free) license. 2) it is reasonable to require each user to have access and has not caused any issues. this also allows other features like row level filtering to be considered in future.
Answering my own post. Yes I have implemented a custom spfx web part that does the filtering as described in the original question. There are several resources that pointed me in the right direction.
https://www.youtube.com/watch?v=OcYHf3s_qH0 by Critical Path Training
Connect to API secured with Azure Active Directory (Azure AD) | Microsoft Docs
google "spfx power bi" for more.
Following the MS instructions produces a "user owns data" web part, so each user must have access to the workspace.
Other considerations still to test - 1) guest users, and 2) do I need an 'app owns data' version, where we use a master user's credentials, so that customers do not need a Power BI license.
UPDATE: 1) works for guest users as long as they have access to the workspace and they have a power bi (free) license. 2) it is reasonable to require each user to have access and has not caused any issues. this also allows other features like row level filtering to be considered in future.
Hi Mbalcarek,
sounds very interesting and great. I also have the problem, that URL filter parameters are not taken into consideration by the Power BI report web part.
Could you please share your spfx web part that does the URL filtering?
Thank you.
Andy
Replying to my own post.
This looks promising: GitHub - pankajsurti/PowerBIEmbeddedSPFX: This repo is to show Power BI Embedded SPFX
Without this, it seems that the desired approach is to use Power BI row level security to limit what a user sees.
Hi @Mbalcarek,
In fact, I think power bi does not support these features. (these requirements are listed on the document limitations list)
Embed a report web part in SharePoint Online - Power BI | Microsoft Docs
Perhaps you can submit an idea to improve that features.
Regards,
Xiaoxin Sheng
Xiaoxin, thanks for your response, but you did not answer my question.
Hi @Mbalcarek,
As I said, these features have been limited and list on the document limitations so you can't achieve them on the SPO side. (that's the reason I recommend you submit ideas to improve them)
Regards,
Xiaoxin Sheng
Hi Xiaoxin Sheng,
If I may restate my question: Is it possible to use code similar to https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/React-TS and put an spfx wrapper around it in order to customize a Power BI web part for use in SharePoint Online? And if so, can I use either app-owns-data or user-owns-data or am I restricted in some way? Thank you for your response.
I think you can use an azure function to get the embeded token required to authenticate against PowerBI. So call azure function (or whatever) and get the embeded token needed before you grab the PowerBI. If someone could confirm that this works that would be great. https://www.youtube.com/watch?v=weZH70IhPXU
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |