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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Distribute values accross all matching

I need to reduce the values of a dataset 1 by the results of data set 2.  The problem is that the dataset 1 is more granular than dataset 2.  I was wondering if I make a concatenated field for each dataset that combines the four fields they share, if I can distribute the values of dataset 2 accross all matching rows in dataset 1

 

I can provide samples of each dataset if needed.

 

 

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

I'm not sure if I understand you 100%, because "I need to reduce ..." contradicts "... distribute the values of dataset 2 across ... in dataset 1"

 

But nevertheless, you can achieve both using Power Query.

 

Start with Merging queries:

https://support.office.com/en-us/article/merge-queries-power-query-fd157620-5470-4c0f-b132-7ca2616d1...

 

And this may help to reduce dataset 1 by a join condition with dataset 2:

https://docs.microsoft.com/en-us/powerquery-m/joinkind-inner

 

Hopefully, this gets you started, if not, please prepare an Excel sheet with sample data, one sheet for one dataset and use the 3rd sheet to explain your expected result. Upload the file to onedrive or dropbox and share the link

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

I'm not sure if I understand you 100%, because "I need to reduce ..." contradicts "... distribute the values of dataset 2 across ... in dataset 1"

 

But nevertheless, you can achieve both using Power Query.

 

Start with Merging queries:

https://support.office.com/en-us/article/merge-queries-power-query-fd157620-5470-4c0f-b132-7ca2616d1...

 

And this may help to reduce dataset 1 by a join condition with dataset 2:

https://docs.microsoft.com/en-us/powerquery-m/joinkind-inner

 

Hopefully, this gets you started, if not, please prepare an Excel sheet with sample data, one sheet for one dataset and use the 3rd sheet to explain your expected result. Upload the file to onedrive or dropbox and share the link

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
I_Like_Pi
Resolver II
Resolver II

I only dabble in PBi and am a kludge king, so this is surely not the best performing way.

 

In the query editor duplicate DS1 (or reference it i.e. source = DS1) and group on the common field with only a count (consider other metrics if you think they might be useful).

Back in Power BI, relate DS2 to your new summary and build a calculation from the count and the related DS2 value (AdjustmentVal = Divide(Related(DS2Value), Count) assuming you wish to evenly distribute the adjustment. Using Divide you wont get div 0 errors.

 

Relate DS1 to the Summary and use the adjustment value in a calculated column (Adjusted = Core_Val - Summary[AdjustmentVal])

 

Good luck 🙂

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors