Forum Discussion

RayT's avatar
RayT
New Member
5 years ago

Is there a way to prevent discarding query changes?

I have a desktop file that has data connections to a SQL Server database with SQL code accessbible from the Power Query Editor. I would like to send the file to a client without the SQL code and database connections, but still have the dashboard intact. I removed the database connections and deleted the SQL code the Power Query editor and saved the pbix file without applying changes. 

 

Is there a way to prevent the client from "discarding" the changes and getting the SQL code back? If I apply changes, the dashboard breaks but there is a banner at the top that asks to either apply or discard changes and I would not like to anyone to be able to discard the changes. Is this possible?

 

Thanks

2 Replies

  • Hi RayT !

    You need to save your .pbix as Power BI Template, and share the template .pbit file. When open by client it will be asked to provide connection string.

     

    Regards,

    Hasham

  • v-jingzhang's avatar
    v-jingzhang
    Icon for Community Support rankCommunity Support

    Hi RayT 

     

    Visuals on report pages always need some data to populate them to display well. How do you connect to your SQL Server database? If you use Import, your data is imported into the model. When the client open this pbix file, they will see visuals which are populated with your sample data. If you use DirectQuery, the client won't see any populated visual because they don't have access to the data source in this file. In both scenarios, they won't see data in Power Query Editor because the data preview in Power Query Editor only displays when the user has access to the defined data source in the file.

     

    For the client to see the report populated with their own data, they will need to change the data source to connect to their own database. You could refer to below articles about how to change the data source for existing reports.

     

    Reference:

    How To Change Data Source Of Existing Report In Power BI (c-sharpcorner.com)

    How to Switch Your Power BI Table to a Different Data Source Type Without Breaking Anything – business intelligist

     

    Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as the solution to help other members find it.