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
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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors