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

calculating lower price in lists per unique product

Hi, I am trying to create a calculated column (Cheapest Key) where i want a "1" on the row if Column "Comp Segment" = Key and then i want the "1" on the row with the lowest "Pricerank". So in the picture below i only want a "1" on the row i have red circle. https://imgur.com/GuuxARh This logic should be applied on all unique products ("Sku"). Can anyone help me?
1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @Anonymous

Try this for the new calculated column:

 

Cheapest Key =
VAR _MaxSKUPrice =
    CALCULATE (
        MAX ( Table1[PriceRank] ),
        ALLEXCEPT ( Table1, Table1[SKU] ),
        Table1[Comp Segment] = "Key"
    )
RETURN
    IF ( Table1[Comp Segment] = "Key" && Table1[PriceRank] = _MaxSKUPrice, 1 )

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks, that works! For some reason it says authentication failed when I try to accept is as solution, but as soon as it is working again Ill press accept. Thanks again many many times!

Hi @Anonymous

 

Glad to hear you've solved it, please accept the helpful reply as solution, that way, other community members will easily find the solution when they get same issue

 

Regards,

Cherie

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

Hi @Anonymous

Try this for the new calculated column:

 

Cheapest Key =
VAR _MaxSKUPrice =
    CALCULATE (
        MAX ( Table1[PriceRank] ),
        ALLEXCEPT ( Table1, Table1[SKU] ),
        Table1[Comp Segment] = "Key"
    )
RETURN
    IF ( Table1[Comp Segment] = "Key" && Table1[PriceRank] = _MaxSKUPrice, 1 )

 

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.