Forum Discussion
Rankx an Aggregated Fieldin a calculated column while ignoring others.
You may try below calculated column:
Column =
RANKX (
FILTER (
salesdashboard_pos,
salesdashboard_pos[pos_date] = EARLIER ( salesdashboard_pos[pos_date] )
),
CALCULATE (
SUM ( salesdashboard_pos[Total POS $] ),
ALLEXCEPT (
salesdashboard_pos,
salesdashboard_pos[pos_end_customer_name],
salesdashboard_pos[pos_date]
)
),
,
DESC
)
Regards,
- Matthew_Theis7 years ago
Advocate II
Hello v-cherch-msft and thank you for the input. The calculation that you provided gets us very close to the desired solution. What's happening is that we are ranking with a Skip by sum(Total POS $). If we change to Dense, that will solve the problem towards the top end of the list, where sum(Total POS $) is unique for each customer. We run into a problem towards the bottom of the order where many distinct customers share the same value of sum(Total POS $). I would like to see a ranking for distinct customers...which is where a Skip would make sense, but that doesn't work at the top of the list (Ex. Zyteq Technologies should have a rank of 3).
I kept at it with this...Total Customer Sales per Month =VARCurrentDate =salesdashboard_pos[pos_date]VARCurrentCustomer =salesdashboard_pos[pos_end_customer_name]ReturnCALCULATE(SUMX(FILTER(ALL(salesdashboard_pos),salesdashboard_pos[pos_date]=CurrentDate &&salesdashboard_pos[pos_end_customer_name]=CurrentCustomer),salesdashboard_pos[Total POS $]))
and then I ranked that Dense...This looks alright at the top, but lower you begin to see the issue. 1. Kelei has a counterpart somewhere else with a Total POS $ of 1 and Rank per Month of 4786. It's at this point, where multiple distinct customers share the same Total Customer Sales per Month (also Rank) where we would want to skip the rank. Any ideas on how to solve this issue?Thanks!Matthew- v-cherch-msft7 years ago
Microsoft Employee
Could you share some simplified sample data which could reproduce your scenario and your desired output?
Regards,