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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
doodlleus
Frequent Visitor

Report visuals after programmatic relationship creation

Hi, I am having a weird issue.
 
I create my whole dataset from scratch using the microsoft analysis service tabular libraries in c#.
This is all fine but if i create a new relationship between two tables programatically and push it to the dataset in powerbi then any existing reports I have do not "see" this relationship straight away but instead it seems to be on approximately a 5 minute lag.
 
It doesn't seem to make any difference refreshing the dataset or refreshing the report visuals until this lag finishes in which case as soon as i click to refresh the report visuals, the relationship starts working.
 
Is it the case that even after you trigger a dataset refresh, the power bi reports see some sort of server cached version until that cache expires and there is nothing I can do about it or is there a better way I can make imiediate relationship changes programmatically?
 
Just to flesh things out, it isnt a browser cache issue because even if i create a brand new report against that dataset it still sees the "old" data/schema until this lag finishes where it, along with the other report, starts working fine.
 
Thanks for any help
2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @doodlleus ,

How did you create the relationship between these two tables? Is there any other relationship created between them before you create this relationship programatically? The 5-minute lag you mentioned is that the page will stand still or will it be a blank page or there will be a pop-up window similar to alarm?

Requirements for relationships

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, the relationship was created programatically using the microsoft.analysisservices.tabular libraries. It is the same way that I created the dataset. there are no other relationships

 

The page is still functiuonal but the visual (a matrix table in this instance) shows the error message saying it cant display because there isnt a relationship, despite it existing in the dataset but the rest of the report is absolutely fine. After 3-5 minutes, refreshing the visual now picks up the new relationship and works as intended

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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