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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
danielsa
New Member

Control Dataset Columns and Visual Columns Programmatically

I am using directquery and handling very sensitive data, which I need to be able to view with the desktop version on a locked down server, however when publishing to Azure, need to remove sensitive fields from the data model and replace any sensitive fields in visualizations with alternative ones.  I am currently doing this as a manual task and it takes quite some time.

 

The sensitive data can not be put online, so using the REST Api would not be an option for me.

 

It would be great if there was some interop, library or API method to allow modification of the PBIX file directly, to hide columns/tables and change the data fields used in visualizations.

 

I effectivly need to be able to manage two versions of the same reports, one with online facing fields and one with fields that are okay to display in a locked down environment.

4 REPLIES 4
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @danielsa,

 

Due to we can't use REST API, I think there isn't another way to manipulate PBIX. We already have Power BI to do so. Maybe there is a workaround. Could you please post more information about these below?

1. Do you mean "to Azure" is "to Power BI Service"?

2. Do we need to change the visualizations often?

3. What steps do you do now?

4. Could you please post a sample with dummy data?

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello Dale,

 

Thank you for your reply.

 

To clarify on some of your points:

1. Do you mean "to Azure" is "to Power BI Service"?

I would mean when the report is published from the power bi desktop app to the app.powerbi.com website (using direct query so data would not be published with the report).

 

2. Do we need to change the visualizations often?

The reports would be updated per user requests for new data not currently in the data model, or for addition of new standardized reports for commonly requested views on data.

 

3. What steps do you do now?

Currently my process is as follows

  • I keep two copies of the report file, a identifiable one and a generic one
  • I make any new changes to the identifiable one
    • Creating visualizations with people identifiable data, such as addresses etc
  • I then copy this file and rename it to generic
  • I then go through the generic file and remove any people identifiable information
    • By replacing it with generic information (such as an internal ID) in visualizations
    • Or hiding the fields in the data model, so end users can't edit their own reports and add these fields
  • I then publish the generic file for general internal organization consumption, from the PowerBI website
  • Anyone who has access to the very sensitive data has a method to access a staging area with the identifiable file using power bi desktop

 

4. Could you please post a sample with dummy data?

I do not think a sample will add much, looking at the above description... I am just looking for a way to automate hiding columns in the generic pbix file and changing the columns displayed in visualizations.

 

 

It does not look like a very complicated problem, but the complexity involved is introduced with the sensitivity of the data and the number of tables and columns involved, which introduces a high level of probability of mistakes as the reports evolve over time compared to an automated solution.

 

The current system has around 87 tables with over 500 columns and measures... so is fairly large.  So manually making these changes takes time away from me on database/query optimization on the SQL Server backend, with it being directquery.

 

Hi @danielsa,

 

How about a Power BI templates? It sounds helpful. Please reference: deep-dive-into-query-parameters-and-power-bi-templates

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
danielsa
New Member

I am using directquery and handling very sensitive data, which I need to be viewable by administrators with the desktop version on a locked down server, however when publishing to Azure for general users, need to remove sensitive fields from the data model and replace any sensitive fields in visualizations with alternative ones.  I am currently doing this as a manual task and it takes quite some time.

 

The sensitive data can not be put online, so using the REST Api would not be an option for me.

 

It would be great if there was some interop, library or API method to allow modification of the PBIX file directly, to hide columns/tables and change the data fields used in visualizations.

 

I effectivly need to be able to manage two versions of the same reports, one with online facing fields, available just within our company network and one with fields that are okay to display in a locked down environment.

 

Any help/advise would be greatly appreciated.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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