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
KNalewajka
New Member

Using single set of queries to achieve separate outputs

I have a sales data set with a list of sites belonging to three different customers. Through series of queries I dynamically merge and split the columns, to have a dynamic list of columns for each site. It works fine for a single customer, but I need to make three separate outputs, each for separate customer.

 

Sample data:

 

CustomerSiteProductSalesQty
Customer 1Cust1_Site 1Prod11010
Customer 1Cust1_Site 2Prod21515
Customer 1Cust1_Site 1Prod21010
Customer 2Cust2_Site 1Prod11510
Customer 2Cust2_Site 2Prod2 2015
Customer 3Cust3_Site 1Prod12530
Customer 3Cust3_Site 2Prod11520

 

Output needed:

Customer 1:

ProductCust1_Site 1 SalesCust1_Site 1 QtyCust1_Site 2 SalesCust1_Site 2 Qty
Prod11010  
Prod2 10101515

 

Customer 2:

ProductCust2_Site 1 SalesCust2_Site 1 QtyCust2_Site 2 SalesCust2_Site 2 Qty
Prod11510  
Prod2   2015

 

Customer 3:

ProductCust3_Site 1 SalesCust3_Site 1 QtyCust3_Site 2 SalesCust3_Site 2 Qty
Prod125301520

 

Due to the fact that the list of sites changes from month to month I need to keep it as a series of queries and lists, which makes copying the whole process for each customer cumbersome.

 

I was told there might be a way to use customer name as a parameter and have Power Query use the whole process separately for each customer, by overriding the parameter from the output query. I can't figure out how to do it. Is that possible, and if yes, could anybody give me some hints as to how?

1 ACCEPTED SOLUTION
MarkLaf
Memorable Member
Memorable Member

Rather than changing the shape of your data in Power Query, this feels like something you can achieve more simply with a matrix and filters (eg use a single-select slicer).

 

MarkLaf_0-1747260382705.gif

 

If you need to ensure that certain users can only see one associated customer, then you can achieve with RLS: https://learn.microsoft.com/en-us/fabric/security/service-admin-row-level-security

 

If you have particular business requirements where the above is not applicable, then you could go the parameters route. Can you confirm that you are trying to do what is described here and, if yes, what is the part that you are getting stuck on? https://learn.microsoft.com/en-us/power-bi/connect-data/service-parameters

View solution in original post

5 REPLIES 5
mussaenda
Super User
Super User

Hi @KNalewajka ,

 

it is advisable to do the separation in Visuals instead of in Power Query.

v-sshirivolu
Community Support
Community Support

Hi @KNalewajka  ,
Thank you @MarkLaf  for the helpful response!

I wanted to check in on your situation regarding the issue. Have you resolved it? If you have, please consider marking the reply that helped you or sharing your solution. It would be greatly appreciated by others in the community who may have the same question

Thank you.

 

Hi @KNalewajka 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If our response has addressed your query, please Accept it as a solution so that other community members can find it easily.


Thank you.

 

Hi @KNalewajka !
May I ask if you have resolved this issue? If so, please mark the helpful reply and Accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

MarkLaf
Memorable Member
Memorable Member

Rather than changing the shape of your data in Power Query, this feels like something you can achieve more simply with a matrix and filters (eg use a single-select slicer).

 

MarkLaf_0-1747260382705.gif

 

If you need to ensure that certain users can only see one associated customer, then you can achieve with RLS: https://learn.microsoft.com/en-us/fabric/security/service-admin-row-level-security

 

If you have particular business requirements where the above is not applicable, then you could go the parameters route. Can you confirm that you are trying to do what is described here and, if yes, what is the part that you are getting stuck on? https://learn.microsoft.com/en-us/power-bi/connect-data/service-parameters

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.

Top Solution Authors