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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

Hi @Anonymous ,

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

Anonymous
Not applicable

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.