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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
oorf
Frequent Visitor

Concat a list while preserving ranks

Hello,

 

I have used the following Dax formula to create a measure that ranks my top Client Groups by Fail Count per Location

 

Rank Client Fail Group = IF (
    ISINSCOPE( 'Fail List'[Client Groups] ),
    RANKX (
        CALCULATETABLE (
            VALUES ( 'Fail List'[Client Groups] ),
            ALLSELECTED ( 'Fail List'[Client Groups] )
        ),
       CALCULATE( SUM('Fail List'[Fail Count]))
    )
)
 
oorf_2-1678295507181.png

 

 

 

As this table will be too long to display all of my 10 locations + their top three fails I am wanting to combine the top three fails into one cell so that my table will look like

 

oorf_1-1678295448965.png

 

 

What is the best way to do this given the rank measure I already have?

 

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

Hi , @oorf 

According to your description, you want to show the 3nd group names per Location.

Here are the steps you can refer to :
(1)This is my test data:

vyueyunzhmsft_0-1678413445478.png

(2)We can create a measure like this:

Measure = var _t = SUMMARIZE('Table','Table'[Client Groups] , "failCount", SUM('Table'[Fail Count]))
var _t2=FILTER( ADDCOLUMNS(_t , "rankx" , RANKX(_t, [failCount] , ,DESC,Dense)) , [rankx]<=3)
return
CONCATENATEX(_t2, [Client Groups],",",[rankx])

(3)Then we can put the fields we need on the visual and we can meet your need:

vyueyunzhmsft_1-1678413486000.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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-yueyunzh-msft
Community Support
Community Support

Hi , @oorf 

According to your description, you want to show the 3nd group names per Location.

Here are the steps you can refer to :
(1)This is my test data:

vyueyunzhmsft_0-1678413445478.png

(2)We can create a measure like this:

Measure = var _t = SUMMARIZE('Table','Table'[Client Groups] , "failCount", SUM('Table'[Fail Count]))
var _t2=FILTER( ADDCOLUMNS(_t , "rankx" , RANKX(_t, [failCount] , ,DESC,Dense)) , [rankx]<=3)
return
CONCATENATEX(_t2, [Client Groups],",",[rankx])

(3)Then we can put the fields we need on the visual and we can meet your need:

vyueyunzhmsft_1-1678413486000.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

This worked perfectly, thank you so 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