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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Balaraju
Helper III
Helper III

Need to get store Rank based on Store Type

Hi All,

 

I hope all are doing good,

 

I have one requirement, where I need to get store ranking based on store type. Below I have attached the POC with the required output.

For eg: If I have Store X, Y, and W under store type A I need to get the ranking of a particular store under store type A and also the same for stores under store type B.

 

Balaraju_0-1663146747718.png

 

Please help me out with this.

 

Thanks,

Balaraju

 

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

Hi @Balaraju ,

According to your description, here's my solution.

Create two calculated colulmns.

 

Under A Store Rank =
IF (
    'Table'[Store Type] = "A",
    RANKX ( FILTER ( 'Table', 'Table'[Store Type] = "A" ), 'Table'[Sales] ),
    0
)
Under B Store Rank =
IF (
    'Table'[Store Type] = "B",
    RANKX ( FILTER ( 'Table', 'Table'[Store Type] = "B" ), 'Table'[Sales] ),
    0
)

Or you can do it in a single column.

Column =
RANKX (
    FILTER ( 'Table', 'Table'[Store Type] = EARLIER ( 'Table'[Store Type] ) ),
    'Table'[Sales]
)

 

Get the correct result.

vkalyjmsft_0-1663227737821.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

View solution in original post

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @Balaraju ,

According to your description, here's my solution.

Create two calculated colulmns.

 

Under A Store Rank =
IF (
    'Table'[Store Type] = "A",
    RANKX ( FILTER ( 'Table', 'Table'[Store Type] = "A" ), 'Table'[Sales] ),
    0
)
Under B Store Rank =
IF (
    'Table'[Store Type] = "B",
    RANKX ( FILTER ( 'Table', 'Table'[Store Type] = "B" ), 'Table'[Sales] ),
    0
)

Or you can do it in a single column.

Column =
RANKX (
    FILTER ( 'Table', 'Table'[Store Type] = EARLIER ( 'Table'[Store Type] ) ),
    'Table'[Sales]
)

 

Get the correct result.

vkalyjmsft_0-1663227737821.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

It's working thank you very much

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors