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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
kmckenzie
New Member

Data Masking with Dynamic M Query

I am attempting to mask confidential data (Customer Names) to show how Customer A stacks up vs Customer B and so on.

 

I currently have a list of Customers with the Sanitized Customers.

 

Ex:  

CustomerSanitized
MicrosoftCustomer A
AppleCustomer B
GoogleCustomer C

 

I would like to be able to show Microsoft's data as "Microsoft" when presenting data to them specifically, while all others are using generic Customer A, B, etc.

 

I believe this can be done using Dynamic M Query Parameters but am currently finding difficulty writing the query.

 

Any help is appreciated.  Thanks!

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @kmckenzie ,

 

According to your description, I refer to a blog where you can randomize the data during the refresh in Power Query to achieve the effect of blocking the data you don't want to show.

vhenrykmstf_0-1646101741542.png

 

For more details, you can read related blog link as below:

Masking confidential data in Power BI reports - DataChant


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @kmckenzie ,

 

According to your description, I refer to a blog where you can randomize the data during the refresh in Power Query to achieve the effect of blocking the data you don't want to show.

vhenrykmstf_0-1646101741542.png

 

For more details, you can read related blog link as below:

Masking confidential data in Power BI reports - DataChant


If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

lbendlin
Super User
Super User

That's not what dynamic query parameters are for. Their purpose is to help with query performance optimization.

 

I would (strongly) recommend that you do your data masking in the upstream systems, and that you present different reports based on different dataset to your different audiences.  Trying to do all this in Power BI is inviting trouble and will lead to data leaks.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors