cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Syndicate_Admin
Administrator
Administrator

Power BI. Create column sorting by item and type of discount, indicating the purchase priority

Hello!!!

These are items that come from different manufacturers.
Each manufacturer offers a different discount for the purchase of their items.
We have a table with 4 columns: Item, manufacturer, item&manufacturer and discount.
You would need a 5th column where the purchase priority appears.
That is, product 105 is produced by 4 different manufacturers; From manufacturer 1 I can get 62% discount, from manufacturer 2, 60%, from manufacturer 3 40% and manufacturer 4 30%.
In case the same item has the same discount in different manufacturers the priority must be the same.

ARTICLEMAKERART&MANUFACTURERDISCOUNTPRIORITY
1051105 // 1621
1052105 // 2602
1053105 // 3403
1054105 // 4304
2771277 // 1621
2772277 // 2602
2774277 // 4602

Thank you very much in advance for your help.

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1680409208587.png

 

 

Priority measure: = 
IF (
    HASONEVALUE ( Data[ARTICLE] ),
    RANKX (
        FILTER ( ALL ( Data ), Data[ARTICLE] = MAX ( Data[ARTICLE] ) ),
        CALCULATE ( SUM ( Data[DISCOUNT] ) ),
        ,
        DESC
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

Syndicate_Admin
Administrator
Administrator

Thank you very much @Syndicate_Admin .

It works perfectly.

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Thank you very much @Syndicate_Admin .

It works perfectly.

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your datamodel looks like, but please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1680409208587.png

 

 

Priority measure: = 
IF (
    HASONEVALUE ( Data[ARTICLE] ),
    RANKX (
        FILTER ( ALL ( Data ), Data[ARTICLE] = MAX ( Data[ARTICLE] ) ),
        CALCULATE ( SUM ( Data[DISCOUNT] ) ),
        ,
        DESC
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors