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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
matheuses
Frequent Visitor

Relationships Not Working After Embedding

Hi, on the screenshot is the modeling I have for the problematic part of the report. The cardinality of the relationships are correct and I'm pretty sure the direction of the filters are as well, since I'm able to properly filter the report both on Desktop and Service versions of Power BI. 

matheuses_3-1735335371770.png

 

The problem starts when we go to the Embedded version. At first it loads fine, but whenever I filter by contact, it breaks all visuals except the ones that rely only on data coming from the contacts table.
It makes sense to me that it's a problem on this side of the modeling since it's the only place I have a potential cyclic relationship for contacts and location and because it only breaks when I filter by Contact, I just don't know what can be done here since it works fine on the Service and Desktop versions. I also don't understand the error message I get, since it mentions the Items on Order table and it has a pretty simple relationship with the main dimension table. Here's a screenshot of the error I get:

matheuses_2-1735335111440.png

 

1 ACCEPTED SOLUTION
matheuses
Frequent Visitor

Solved the issue by using Power Query to bring the information I needed from the location table to the contact table and then deactivating (not deleting) the relationships between the two. Had to do some DAX adjustments to account for the change, but it's working fine now.

View solution in original post

13 REPLIES 13
matheuses
Frequent Visitor

Solved the issue by using Power Query to bring the information I needed from the location table to the contact table and then deactivating (not deleting) the relationships between the two. Had to do some DAX adjustments to account for the change, but it's working fine now.

v-ssriganesh
Community Support
Community Support

Hi @matheuses,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.

v-ssriganesh
Community Support
Community Support

Hi @matheuses,

May I ask if you have resolved this issue? If so, please mark the helpful reply and Accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

v-ssriganesh
Community Support
Community Support

Hi @matheuses 

Thank you for sharing the details of the issue you're facing. I understand that you're encountering an error when filtering by contact in the Embedded version of your Power BI report.

Based on the error message and the behaviour you described; it appears that there are multiple paths to reach the "Location Table" from the "Items on Order Table" in your data model. This creates a circular or many-to-many relationship, which can cause issues in Power BI, especially when filtering.

Here's a breakdown of how to approach this problem:

  • Open your Power BI model in Desktop and navigate to the "Relationships" view. This will provide a visual representation of the connections between your tables. Carefully examine the paths from "Items on Order Table" to "Location Table." Look for any circular or ambiguous connections that might be causing the issue.
  • identify and remove any unnecessary relationships that are not required for your analysis.
  •  If you have a many-to-many relationship between two tables, consider creating a bridge table to establish a clear and unambiguous relationship. If possible, restructure the relationships to create a clear hierarchy and avoid circular dependencies.
  • Utilize DAX functions to implement the desired filtering logic without relying on the ambiguous relationship paths. For example, you can create calculated columns to flag records based on specific conditions related to "Contact" and "Location."
  • Create a simplified version of your data model with fewer relationships to isolate the issue and test different solutions. Once the simplified model works correctly, gradually add back relationships to the original model to pinpoint the source of the problem.
  • After making changes to the data model or DAX calculations, thoroughly test the report in the Embedded environment to ensure the issue is resolved.

I hope this detailed response helps you resolve the issue with your Embedded Power BI report. If you have any further questions, please feel free to ask. If this solution works for you, kindly Accept it as a solution and give a "Kudos" so that other members can find it more easily.
Thank you.

Hi, thanks for the response! What I don't understand is how the report works on the Service and Desktop versions, but doesn't on the Embedded version, how the filtering works just fine on those two versions, but doesn't on the other, could it possibly be a different problem than this? Because if it actually was a relationship problem, I would be getting this error on all 3 platforms, no?

Hi @matheuses,

You're right, the fact that the report works correctly in Service and Desktop versions but not in the Embedded version suggests that the issue might be related to the specific environment of the Embedded deployment.


Your observation that the problem arises when using RLS strongly points towards it being the root cause. Here's why:

  • RLS dynamically filters data based on the current user's context. In your case, using userprincipalname() likely limits the data available to the user. The way RLS is applied and the user context is determined can differ between the Service, Desktop, and Embedded environments.
  • The RLS rules, especially with the userprincipalname() function, might be interacting with the existing relationships in your model in a way that only causes issues in the Embedded environment.

Troubleshooting Steps:

  1. Start with a very basic RLS rule to isolate the issue. For example, try filtering data based on a static value instead of userprincipalname(). Gradually increase the complexity of the RLS rule to pinpoint the exact condition that triggers the error.
  1. Carefully analyse how your RLS rules interact with the relationships between tables in your model. Look for any potential conflicts or inconsistencies. Consider using the "Relationships" view in Power BI Desktop to visualize the relationships and how they are affected by RLS.
  2. Test the report in the Embedded environment with different users to see if the issue is specific to certain users or roles. Ensure that data refreshes are happening correctly in the Embedded environment. Incorrect data refreshes can lead to unexpected behaviour and errors.

If the issue persists, consider reaching out to Microsoft Support for further assistance. Below link is to create Microsoft support ticket:
https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket

If this helps then please Accept it as a solution and dropping a "Kudos" so other members can find it more easily.
Thanks.

Hi @matheuses,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

Is RLS involved?

Yes, I have RLS set up. Just tested here and it seems like that's the problem. I still don't understand what could be happening here though, how does it work when not using a specific user and it doesn't when I am? My RLS is as simple as a just using 'userprincipalname()'

Most likely your RLS rules result in no data being returned for a measure that is required for your visual. 

 

This seems to be the same pattern as the other "Embedded"  issue here in the forums.

lbendlin
Super User
Super User

This might be related

 

Multiple Join Paths in Power BI Embedded, But Not ... - Microsoft Fabric Community

 

When did the error start?

Yes, it could be, thanks for relating me to that post. It started as soon as I published the report, any ideas?

If you have a Pro license you can open a Pro ticket at https://admin.powerplatform.microsoft.com/newsupportticket/powerbi
Otherwise you can raise an issue at https://community.fabric.microsoft.com/t5/Issues/idb-p/Issues .

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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