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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
richard-powerbi
Post Patron
Post Patron

Switching between working local/online

I made an if statement to change my source between local and SharePoint. It works with a parameter where I choose local or SharePoint, in the if statement it uses either Folder.Files or SharePoint.Files. I make sure to put the parameter on SharePoint before I publish the dataset. On the web I get the error under the dataset setting telling me Folder.Files is unsupported and thus scheduling refresh is disabled. I thought I did something clever, apparently not. I understand it scans my pbix for unsupported functions, but I assumed functions that are not accessed inside an if statement would be be ignored.
In power bi desktop this switch works beautifully. SharePoint files are always synced to my desktop through OneDrive syncing, thus working local is much faster, because it only has to download the files once.
Is there another way to quickly switch between local and SharePoint? I don't want to lose the scheduled refresh ability, and the error on the web worries me.
1 ACCEPTED SOLUTION
GilbertQ
Super User
Super User

What I would do, is to always have it pointing at the SharePoint Files.

This will mean no matter when you access it, it will be consistent, and allow you to refresh the data.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

2 REPLIES 2
GilbertQ
Super User
Super User

What I would do, is to always have it pointing at the SharePoint Files.

This will mean no matter when you access it, it will be consistent, and allow you to refresh the data.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

As long as there is any Quary that enumrates the local dive, the PBIX cant be published to the service, even if you employ a if statement & a parameter to switch sorces.

 

So the trick is to convert the Quary that conatins the local sorce to a function (remember to delink the function you created using properties) & then detele the orignal Quary. Call the function in the IF statement in place of the local quary table .

 

This way the table listing the local drive does not activate till the condition is tru & a connection is not created untill the parimeter wants it to.

 

Continew to work on Local as it help in faster preview with no internet latency during develeopment & when you are ready to publish switch to sharepoint souce. This time the If statement skips the function so the table is not created & hencewill not be part of the publish. 

 

You need to refresh once then you can publishing without any errors.

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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