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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. 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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors