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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Matthew_Theis
Advocate II
Advocate II

Rank Customers by Aggregated Value

Hello all,

I'm trying to rank customers by the SUM (Total POS $) and am having difficulty getting Rankx to work as I would like it to.  I have the following table: Ranking Customers.PNG  In this case, what I would like to do would be to aggregrate Total POS $ for each pos_end_customer_name for the month.  I would like to ignore for the time being business_group and vp_area_description.  Example on Feb 1st, I would like to aggregate $ for Zyteq (197 + 32) and rank this against all other unique customers throughout the rest of the month.  I've tried the following: 

Rank C =
RANKX(
      SUMMARIZE(
            salesdashboard_pos,
            salesdashboard_pos[pos_date],
            salesdashboard_pos[pos_end_customer_name],
            "Sum Total $",
            SUM(salesdashboard_pos[Total POS $])
      ),
      MIN([Sum Total $]),
      ,
      DESC
)
But I am met with an error: "Column 'Sum Total $' cannot be found or may not be used in this expression."  
I do need this to be a calculated column so that I can perform analysis on the ranking value...ie Avg Rev for median customer +/- 500.  Any help would be greatly appreciated.

 

Thanks!

Matthew

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Matthew_Theis ,

 

To use this formula should work.

 

RANK C = 
RANKX (
    salesdashboard_pos,
    CALCULATE (
        MIN ( 'salesdashboard_pos'[Total POS $] ),
        ALLEXCEPT (
            salesdashboard_pos,
            'salesdashboard_pos'[pos_date],
            salesdashboard_pos[pos_end_customer_name]
        )
    ),
    ,
    DESC
)

 

Capture.PNG

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @Matthew_Theis ,

 

To use this formula should work.

 

RANK C = 
RANKX (
    salesdashboard_pos,
    CALCULATE (
        MIN ( 'salesdashboard_pos'[Total POS $] ),
        ALLEXCEPT (
            salesdashboard_pos,
            'salesdashboard_pos'[pos_date],
            salesdashboard_pos[pos_end_customer_name]
        )
    ),
    ,
    DESC
)

 

Capture.PNG

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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