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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
LorenzoC
Regular Visitor

Distribution of values based on percentages

Dear All,

I have a table that looks like this:

CodeGroupValueDate
1abc100015/06/2024
1xyz150030/06/2024
2abc200010/07/2024
3xyz300015/07/2024
4abc100001/06/2024
4abc50002/09/2024
5xyz10003/09/2024

 

What I want to achieve is: for certain codes I want to distribute the value based on percentages within the month.

 

I have another table that control percentages and it looks like this:

Start CodeStart Code DescriptionEnd Code%
2Fruit140
2Fruit460
3Grocery120
3Grocery430
3Grocery550

 

This means that Code number 2 values will always be splitted throught the end codes (1 and 4) with certain percentages.

 

What I want to achieve through PowerQuery or Dax is a table like this:

CodeGroupValueDate
1abc100015/06/2024
1FRUIT80010/06/2024
1xyz150030/06/2024
1GROCERY60015/07/2024
2abc200010/06/2024
3xyz300015/07/2024
4abc100001/06/2024
4FRUIT120010/06/2024
4GROCERY90015/07/2024
4abc50002/09/2024
5GROCERY1500

15/07/2024

5xyz10003/09/2024

 

I think this could be achieved better through Powerquery?

 

Thank you a lot for your support

 

1 ACCEPTED SOLUTION

@LorenzoC 

you can merge two tables and append the result to table 1. pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
ryan_mayu
Super User
Super User

how do you get 800 for 1 FRUIT?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




It is 40% of 2000 (row 3 of table one and row 2 of table two)

why the date is 6/10?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




    Spoiler
    Yeah sorry, that is an error. Date should be 10/07/2024 for code 2. Also, code that have been distributed (in this case 2 and 3) should be removed from the table (otherwise their value would be counted two times)

@LorenzoC 

you can merge two tables and append the result to table 1. pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors