Forum Discussion

Fidzi8's avatar
Fidzi8
Icon for Helper V rankHelper V
5 years ago
Solved

Priority

Hi,

I need a advice.

 

I need in PBI create new column where will be result column "F".

 

Column "F" (Priority) is RATING according to minimum Haulier price (column "D").
But when column "E" (Destination exclusivity) is 100% so column "F" (Priority) is 1. 
 

 

Thank you
Ondřej 

 

 

  • Here is a column expression that shows one way to do it.  Just replace Price with your actual table name.

     

    Priority =
    VAR vThisCode = 'Price'[Code]
    VAR vThisPrice = 'Price'[Haulier price]
    VAR vRank =
        RANKX (
            SUMMARIZE (
                FILTER ( 'Price', 'Price'[Code] = vThisCode ),
                'Price'[Haulier price]
            ),
            'Price'[Haulier price],
            vThisPrice,
            ASC
        )
    RETURN
        IF ( 'Price'[Destination exclusivity] = 11vRank )

     

    Pat

2 Replies

  • mahoneypat's avatar
    mahoneypat
    Icon for Microsoft Employee rankMicrosoft Employee

    Here is a column expression that shows one way to do it.  Just replace Price with your actual table name.

     

    Priority =
    VAR vThisCode = 'Price'[Code]
    VAR vThisPrice = 'Price'[Haulier price]
    VAR vRank =
        RANKX (
            SUMMARIZE (
                FILTER ( 'Price', 'Price'[Code] = vThisCode ),
                'Price'[Haulier price]
            ),
            'Price'[Haulier price],
            vThisPrice,
            ASC
        )
    RETURN
        IF ( 'Price'[Destination exclusivity] = 11vRank )

     

    Pat