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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Lucy_Ramirez
Frequent Visitor

Assign price by higher weight

Hello!!!

I have two measures, one that calculates the weight of sales per item (%Weight) and another that calculates the unit price ($Unit Price)

I need to find a measure that assigns me a unit price for each item.

The unit price I need has to be the one with the highest % weight per item.

My database is the blue part, my measurements are the green part, and the measurements I need are the brown part.

Lucy_Ramirez_0-1703801976975.png

 

I hope you can help me, thank you so much! 🙂 

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

This should typically be solved with a calculated column formula in the Table.  If you are OK with my approach, then share the download link of the PBI file.  If possible, pleasure ensure that column names are in English.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Lucy_Ramirez  Does something like this work for you?

MAX percentage =
CALCULATE ( MAX ( Sheet1[Percentage] ), ALLEXCEPT ( Sheet1, Sheet1[Product] ) )

 

MAX units =
CALCULATE ( MAX ( Sheet1[Units] ), ALLEXCEPT ( Sheet1, Sheet1[Product] ) )

 

bchager6_2-1703805515886.png

 

 

 

43.39Hello!

No, I need to assign a price of the maximum weight.

for example for tostada nachos, te maximum weight is 43.39%, so I need that in all article the price be $4.

 

Any thoughts?

 

Thankyou!

Anonymous
Not applicable

@Lucy_Ramirez @Ashish_Mathur  is right. Calculated columns should be used.

MAX percentage =
MAXX (
    TOPN (
        1,
        FILTER ( Sheet1, Sheet1[Product] = EARLIER ( Sheet1[Product] ) ),
        Sheet1[Percentage]
    ),
    Sheet1[Percentage]
)
 
MAX units =
MAXX (
    TOPN (
        1,
        FILTER ( Sheet1, Sheet1[Product] = EARLIER ( Sheet1[Product] ) ),
        Sheet1[Percentage]
    ),
    Sheet1[Units]
)
 
bchager6_0-1703824915750.png

Thanks to @wdx223_Daniel for the solution.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.