cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mbalcarek
Helper I
Helper I

spfx power bi web part to support filtering in SharePoint Online

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?

1 ACCEPTED SOLUTION
Mbalcarek
Helper I
Helper I

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.

 

View solution in original post

8 REPLIES 8
Mbalcarek
Helper I
Helper I

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

Mbalcarek
Helper I
Helper I

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.

v-shex-msft
Community Support
Community Support

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.

Power BI Ideas

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors