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
sabseb2225
New Member

Grouping data

Hello,

 

I am trying to find solution how to group prices automatically only when concern the same article number.

For example: I sent 6 quotes to different suppliers in order to qoute article 100234.

I have received 5 quotes back. I am going to place the order for article with price $19.

I would like to categorize where rest of suppliers are in terms of prices:

Article no.SupplierPricequote datewonquoted
100234abc201/22/2022 yes
100234erdw191/24/2022xyes
100234ccc301/27/2022 yes
100234bgfs481/27/2022 yes
100234gtgthysr\   no
100234qcs431/24/2022 yes
100453ccc6001/20/2022 yes
100453abc6541/22/2022 yes
100453bddb   no
100453dbfd01/27/2022 yes
100453qcs3221/22/2022xyes
100453gtsg9991/24/2022 yes
1004286attreag1441/27/2022 yes
1004286gtfsgrewtr01/22/2022 yes
1004286abc01/24/2022 yes
1004286qcs1761/27/2022xyes
1004286ccc1991/22/2022 yes
3871978ccc3761/24/2022 yes
3871978abc3881/27/2022 yes
3871978agragf   no
3871978fdaegtrag   no
3871978bddb3121/27/2022xyes

 

If there is empty cell with price : Category: no answer, no quote

If there is "0" in cell with price: Category: answered, no quote

If other price relation to "won" price is less than 10%: Category: 0 - 10%

If other price relation to "won" price is between 10% - 30%: Category: 10% - 30%

If other price relation to "won" price is between 30% - 60%: Category: 30% - 60%.

100234201/22/2022 yes0 - 10% 
100234191/24/2022xyes0 - 10% 
100234301/27/2022 yes30% - 60%
100234251/27/2022 no10% - 30%
100234   no  
100234431/24/2022 yes<60% 

Please note, that sometimes I have five or more quotes for the same article.

Thank you in advance for your support. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sabseb2225 ,

Please try this calculated column:

Category = 
VAR _order =
    CALCULATE (
        MAX ( 'Table'[Price] ),
        'Table'[won] = "x",
        ALLEXCEPT ( 'Table', 'Table'[Article no.] )
    )
VAR _rate =
    DIVIDE ( 'Table'[Price] - _order, _order )
VAR _result =
    IF (
        'Table'[Price] = 0
            || 'Table'[Price] = BLANK (),
        BLANK (),
        SWITCH (
            TRUE (),
            _rate < 0.1, "0 - 10%",
            _rate >= 0.1
                && _rate < 0.3, "10% - 30%",
            _rate >= 0.3
                && _rate < 0.6, "30% - 60%",
            _rate >= 0.6, ">60%"
        )
    )
RETURN
    _result

vcgaomsft_0-1663663800573.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @sabseb2225 ,

Please try this calculated column:

Category = 
VAR _order =
    CALCULATE (
        MAX ( 'Table'[Price] ),
        'Table'[won] = "x",
        ALLEXCEPT ( 'Table', 'Table'[Article no.] )
    )
VAR _rate =
    DIVIDE ( 'Table'[Price] - _order, _order )
VAR _result =
    IF (
        'Table'[Price] = 0
            || 'Table'[Price] = BLANK (),
        BLANK (),
        SWITCH (
            TRUE (),
            _rate < 0.1, "0 - 10%",
            _rate >= 0.1
                && _rate < 0.3, "10% - 30%",
            _rate >= 0.3
                && _rate < 0.6, "30% - 60%",
            _rate >= 0.6, ">60%"
        )
    )
RETURN
    _result

vcgaomsft_0-1663663800573.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Hello Gao, it works! Hats off to you!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.