Forum Discussion
Anonymous
4 years agoNot applicable
Calculated column RANKX with multiple columns
Hi All, As per the image below, I would like to create a calculated column (Rankx) to rank the top products at customer level. By doing so, I would then be able to create a calculated column ("To...
- 4 years ago
Hi Anonymous
The problem is because of that change you did in the code, remove that SUM from line 4 in the code (based on the screenshot you sent)
try this and don't change anything (copy past):
Rankx = RANKX ( FILTER ( ALL ( 'Sales' ), [Customer] = EARLIER ( 'Sales'[Customer] ) ), [Sales], , DESC, DENSE )Output:
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
VahidDM
4 years agoSuper User
Hi Anonymous
Try this to add a Rankx column:
Rankx =
RANKX (
FILTER ( ALL ( 'Table' ), [Customer] = EARLIER ( 'Table'[Customer] ) ),
[Sales],
,
DESC,
DENSE
)
then this to add Top N + Other column:
Top N + Other =
if([Rankx]<=3,[Product],"Other")
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/