Forum Discussion
RANKING VALUE
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:
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
- Anonymous1 year agoNot applicable
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.
- HanhLe1 year agoFrequent Visitor
Hi Anonymous
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
- Anonymous1 year agoNot applicable
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!