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
Anonymous
Not applicable

Distribute values by column data

Hello everyone,

I have a database that when aggregated looks like this:

 

ProductColorSales%
CarBlack2035.7%
Bike 610.7%
BikeBlack2035.7%
BikeWhite1017.9%

 

In the bike product, i have a few bike units without color.  And i need to vizualize it without the black cell, but in a way that i don´t lose total sales. Is it possible to distribute the data proportionally inside the same product category?

The output should look like this:

 

ProductColorSales%
CarBlack2035.7%
BikeBlack2442.9%
BikeWhite1221.4%

 

Thank you,

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Assume 6 is assigned

2/3 to product bike and color blank,   ->20/(20+10)

1/3 to product bike and color white,   ->10/(20+10)

 

Then i create measures

v/c/pr = CALCULATE(SUM(Table1[Sales]),FILTER(ALLEXCEPT(Table1,Table1[Product]),Table1[Color]=MAX(Table1[Color])))

sum/c/pr = CALCULATE(SUM(Table1[Sales]),FILTER(ALLEXCEPT(Table1,Table1[Product]),Table1[Color]<>BLANK()))

per/col/pro = [v/c/pr]/[sum/c/pr]

sum/blank/product = CALCULATE(SUM(Table1[Sales]),FILTER(ALLEXCEPT(Table1,Table1[Product]),Table1[Color]=BLANK()))

result_sale = IF(MAX(Table1[Color])<>BLANK(),MAX(Table1[Sales])+[sum/blank/product]*[per/col/pro])

result_per = [result_sale]/CALCULATE(SUM(Table1[Sales]),ALL(Table1))

12.png

Best Regards
Maggie

 

Community Support Team _ Maggie Li
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

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Is this problem sloved? 

If it is sloved, could you kindly accept it as a solution to close this case?

If not, please let me know.

 

Best Regards

Maggie

Anonymous
Not applicable

Yes, thank you!

 

Sry for late reply, i was on vacation. 

v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Assume 6 is assigned

2/3 to product bike and color blank,   ->20/(20+10)

1/3 to product bike and color white,   ->10/(20+10)

 

Then i create measures

v/c/pr = CALCULATE(SUM(Table1[Sales]),FILTER(ALLEXCEPT(Table1,Table1[Product]),Table1[Color]=MAX(Table1[Color])))

sum/c/pr = CALCULATE(SUM(Table1[Sales]),FILTER(ALLEXCEPT(Table1,Table1[Product]),Table1[Color]<>BLANK()))

per/col/pro = [v/c/pr]/[sum/c/pr]

sum/blank/product = CALCULATE(SUM(Table1[Sales]),FILTER(ALLEXCEPT(Table1,Table1[Product]),Table1[Color]=BLANK()))

result_sale = IF(MAX(Table1[Color])<>BLANK(),MAX(Table1[Sales])+[sum/blank/product]*[per/col/pro])

result_per = [result_sale]/CALCULATE(SUM(Table1[Sales]),ALL(Table1))

12.png

Best Regards
Maggie

 

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

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