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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors