Forum Discussion
Power Apps integration in power bi -PowerBIIntegration.Refresh() is inconsistent in Direct Lake Mode
Implementation
2) Fabric Lakehouse (SQL Analytics Endpoint):
2.1) A data model was created using the Lakehouse SQL Analytics Endpoint.
2.2) A shortcut was created to the Fabric SQL Database.
2.3) The shortcut table was included in the data model.
Note: Changes made in the Fabric SQL Database take 25–30 seconds to reflect in the shortcut.
Edit Form Code:
SubmitForm(EditForm1);PowerBIIntegration.Refresh();
Flow:
A row is selected in the table chart.
Corresponding data is displayed in Power Apps (using a Power Apps Form and Azure SQL as source).
2.1 Row is selected in tabled chart and Fields are edited in Power Apps.
2.2 Save button is clicked.
2.3 Power BI refresh visual is triggered
Issue: This refresh is inconsistent—it sometimes works, but other times it does not.
Thanks,
Abhiram
I don't think Direct Lake mode will get you a deterministic UX. There are random delays in the process. I would go with Direct Query to the database, not the endpoint.
Hi abhiram342 ,
Thanks for posting in Microsoft Fabric Community.
Thanks for providing all the details. From what you're describing, it seems like the issue with PowerBIIntegration.Refresh() is due to how the data is being updated in Direct Lake Mode.
As mentioned by lbendlin , since there can be random delays in propagating changes from the Fabric SQL Database to the Lakehouse, the Power BI visuals may not refresh consistently.Possible Workaround:
You could try adding a small delay before using PowerBIIntegration.Refresh(). This gives the system extra time to make sure all changes are fully synced, making the refresh process smoother.
As lbendlin mentioned, Direct Lake Mode may not offer a fully deterministic experience. If you're looking for more consistent results, using Direct Query directly to the database instead of the endpoint might provide a more stable connection.Also, here's a link that discusses a similar scenario and provides some additional insights.
From Microsoft’s documentation:
Power Apps visual for Power BI - Power Apps | Microsoft Learn
Hope this helps. Please reach out for any assistance.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and a kudos would be appreciated.
Best Regards,
Vinay.
4 Replies
- lbendlin
Super User
Are you connecting to the Fabric SQL database in Direct Query mode? Why are you connecting via the shortcut rather then directly?
You are missing step 2.2.1 - data is patched to the database
- abhiram342
Microsoft Employee
Hi lbendlin - thank you for response!
Are you connecting to the Fabric SQL database in Direct Query mode? Why are you connecting via the shortcut rather then directly?
>> No, I'm using Direct Lake Mode using shortcut. Our data model is based of Lakehouse sql analytics end point . ( for Edit Feature, I'm using Fabric SQL Database)
If I include Fabric SQL Database without shortcut, I believe I will lose direct lake mode i..e in order to get benfit from direct lake mode, I should have single source in data model i.e Lakehouse SQL Anlaytics endpoint instead of Lakehouse SQL Anlaytics endpoint and Fabric SQL Database analytics end point.
You are missing step 2.2.1 - data is patched to the database
>> I see the patching happened automatically , I didn't implemented any custom code.
Thanks,
Abhiram
- lbendlin
Super User
I don't think Direct Lake mode will get you a deterministic UX. There are random delays in the process. I would go with Direct Query to the database, not the endpoint.
- v-veshwara-msft
Community Support
Hi abhiram342 ,
Thanks for posting in Microsoft Fabric Community.
Thanks for providing all the details. From what you're describing, it seems like the issue with PowerBIIntegration.Refresh() is due to how the data is being updated in Direct Lake Mode.
As mentioned by lbendlin , since there can be random delays in propagating changes from the Fabric SQL Database to the Lakehouse, the Power BI visuals may not refresh consistently.Possible Workaround:
You could try adding a small delay before using PowerBIIntegration.Refresh(). This gives the system extra time to make sure all changes are fully synced, making the refresh process smoother.
As lbendlin mentioned, Direct Lake Mode may not offer a fully deterministic experience. If you're looking for more consistent results, using Direct Query directly to the database instead of the endpoint might provide a more stable connection.Also, here's a link that discusses a similar scenario and provides some additional insights.
From Microsoft’s documentation:
Power Apps visual for Power BI - Power Apps | Microsoft Learn
Hope this helps. Please reach out for any assistance.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and a kudos would be appreciated.
Best Regards,
Vinay.