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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors