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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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