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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
tracytran91
Helper III
Helper III

Ranking with multi Columns in Matrix Visual

Hi friends, 

 

I would like to rank our clients based on their contribution in each region.  Therefore, Each Client should have their own rank in each region. Here is my DAX: 

tracytran91_0-1606738473052.png

 

The result didnt correct as I expect. 

qUESTION.png

 

Any help is highly appreciated.

 

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

Hi, @tracytran91 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

d1.png

 

You may create a measure as below.

Client Rank = 
IF(
    ISINSCOPE('Table'[Client Name]),
    var c = SUM('Table'[%Count])
    var clientrank = 
    RANKX(
        ALLEXCEPT('Table','Table'[Location Definition]),
        CALCULATE(SUM('Table'[%Count])),
        ,,Dense
    )
    var result = 
    IF(
        NOT(ISBLANK(c)),
        clientrank
    )
    return
    result
)

 

Result:

d2.png

 

Best Regards

Allan

 

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

3 REPLIES 3
tracytran91
Helper III
Helper III

@v-alq-msft OMG! you saved my day!! Thank a lot buddy!

v-alq-msft
Community Support
Community Support

Hi, @tracytran91 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

d1.png

 

You may create a measure as below.

Client Rank = 
IF(
    ISINSCOPE('Table'[Client Name]),
    var c = SUM('Table'[%Count])
    var clientrank = 
    RANKX(
        ALLEXCEPT('Table','Table'[Location Definition]),
        CALCULATE(SUM('Table'[%Count])),
        ,,Dense
    )
    var result = 
    IF(
        NOT(ISBLANK(c)),
        clientrank
    )
    return
    result
)

 

Result:

d2.png

 

Best Regards

Allan

 

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

amitchandak
Super User
Super User

@tracytran91 , not very clear based on screen shot. refer for category rank in the link

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://www.youtube.com/watch?v=DZb_6j6WuZ0

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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