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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors