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
tsynenkyy
Helper II
Helper II

Duplicated Rank value

Hi everyone,

 

Im getting the following problem:

 

tsynenkyy_0-1648211718915.png

The rank = RANKX( ALLSELECTED( DIM_INVOICE_SUPPLIER[NORMALIZED_NAME] ),[Spend Selection CY],,DESC)

As you can see there are some duplicated Ranks, this should be normal if I have duplicated Spend but its not the case , the spend is diferent but the rank is duplicated. 

 

What I see is if I remove the % field the rank work diferentry even if the spend is the same:

tsynenkyy_1-1648211911230.png

 

Someone have any idea?

1 ACCEPTED SOLUTION

Hi @tsynenkyy ,

 

Try

The rank =
RANKX (
    FILTER (
        ALLSELECTED ( DIM_INVOICE_SUPPLIER ),
        [Suppliers] = MAX ( 'DIM_INVOICE_SUPPLIER'[Suppliers] )
    ),
    [Spend Selection CY],
    ,
    DESC
)

If you still have problems, please provide some sample data and expected results. If it is a .pbix file is the best.

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
tsynenkyy
Helper II
Helper II

Edit:

 

The other measure: Class is this:



Class =
// 1 – defines percentages
VAR topPercentage = 0.8
VAR middlePercentage = 0.95
VAR totalMargin = CALCULATE([Spend Selection CY], ALLSELECTED())

// 2 – finds the ranks separating top class from middle class, and middle class from bottom class
VAR topRankNumber = MAXX(FILTER(ALLSELECTED(DIM_INVOICE_SUPPLIER[NORMALIZED_NAME]), [Cumulated margin]<= totalMargin* topPercentage), [Rank] )
VAR middleRankNumber = MAXX(FILTER(ALLSELECTED(DIM_INVOICE_SUPPLIER[NORMALIZED_NAME]), [Cumulated margin]<= totalMargin* middlePercentage), [Rank] )

// 3 – returns the class of the selected product

RETURN
IF(
OR(ISBLANK([Rank]), ISBLANK([Spend Selection CY])), BLANK(),
IF( [Rank]<=topRankNumber,"Top",IF([Rank]<=middleRankNumber,"Middle","Bottom")))


I took it from google and adapted it
amitchandak
Super User
Super User

@tsynenkyy , is this column -NORMALIZED_NAME - same as the suppliers in visual ?

 

if not try like

 

The rank = RANKX( ALLSELECTED( DIM_INVOICE_SUPPLIER[suppliers] ),[Spend Selection CY],,DESC)

Still not working, the result of that function is even more duplicated ranks

Hi @tsynenkyy ,

 

Try

The rank =
RANKX (
    FILTER (
        ALLSELECTED ( DIM_INVOICE_SUPPLIER ),
        [Suppliers] = MAX ( 'DIM_INVOICE_SUPPLIER'[Suppliers] )
    ),
    [Spend Selection CY],
    ,
    DESC
)

If you still have problems, please provide some sample data and expected results. If it is a .pbix file is the best.

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Amitchandak,

 

Thanks for the answer.

 

Yes is the same field NORMALIZED_NAME, sorry for not indicating it in the post.

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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