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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
HanhLe
Frequent Visitor

RANKING VALUE

Hi everyone,

I want to make a ranking of product type for each lines follow these description, but I got wrong result, hope to receive your help, thanks

HanhLe_0-1728984577276.png

 

10 REPLIES 10
TomasAndersson
Solution Sage
Solution Sage

Hi, 
You need to remove filters on whatever A02, A03 is (products?) so that RANK evaluates over the entire product type and not just over each product. So something like:

 

Rank = 
RANKX(
    ALL(Products[Product]),
    [Average of PPH], //Or whatever measure you want to rank by
    ,
    DESC
    )

 

Try it out and if it doesn't work you can give some more info on how the data is structured and what measures you have been trying so I can give you more specific advice.

 

Good luck!

Hi Tomas, 

Thanks for your advice, maybe I did not descripe clearly about what result I want to have so let me adjust my BIs visual, I want to rank top PPH line produce each product type, and please consider that 1 line can produce multiple product type.

This analysis can help me know that for each product type, which line produce better. Kindly help to check, thanks a lot

HanhLe_2-1729132505435.png

 

 

Hi @HanhLe , hello TomasAndersson, thank you for the prompt reply!

Check the following measure:

Top PPH = 
VAR CurrentProductType = SELECTEDVALUE('Table'[Product Type])  
VAR CurrentLine = SELECTEDVALUE('Table'[Line])               

RETURN
    RANKX(
        FILTER(
            ALL('Table'),                                   
            'Table'[Product Type] = CurrentProductType      
        ),
        CALCULATE(SUM('Table'[PPH])),                                       
        ,
        ASC,                                                  
        DENSE                                                
    )

 Result:

vyajiewanmsft_0-1729492164808.png

Best regards,

Joyce

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

 

Hi 

Could you quick check my data, I follow your instruction but seem it returns wrong result

HanhLe_0-1729585619600.png

 

Hi @HanhLe ,

Thank you for your feedback.

 

Can you please help identify if you have duplicate product lines for your product type?

 

If so, we recommend that you summarise the table first and then rankx according to the summary table:

Table 2 = SUMMARIZE('Table',
'Table'[Line],
'Table'[Product Type],
"PPH",(SUM('Table'[PPH])))

If the issue persists, please upload your sample pbix file for further troubleshooting.


In addition, do not include sensitive information or anything not related to the issue or question.

 

Best regards,

Joyce

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

Hi @v-yajiewan-msft 

Thanks a lots for your checking

Yes I think the issue is from duplicate value by another column is [Date].

I would prefer not to summarize the table coz I still need [Date] filter for analysis

Since I cannot attached pbix file here so please access this link for data with more clear for you.

https://drive.google.com/file/d/12c6i-rNCfTnLAdIkdl7gaDOQ1zCerZ2b/view?usp=sharing

 

Hi @HanhLe ,

 

I’m unable to open the link file you shared.

 

Could you please check the link or provide the information without any sensitive information in a different format?

 

Thank you for your understanding!

Hi @v-yajiewan-msft 

Since I cannot attach file here so please check the link again. I already opened link access

Hi, 

Could you help to check my data, seem the result is not same as yours data's demonstration, thanks

Hi,

Could you help to check my data, seem it does not work

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.