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
chock974
Frequent Visitor

topn and concatenatex

I have table with item1, acts and coefficients.
I want to concatenate the acts and coeff by item1 and bring out the top 5 of the most used (acts+coeff).
example :
table.PNG
expected result : resultat.PNG
 
Thx
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @chock974 ,

I create a table as you mentioned.

vyilongmsft_0-1727060750398.png

Next I create a calculated column and a measure.

Concatenated = 'Table'[ACTE] & " " & 'Table'[COEFF]

vyilongmsft_1-1727060789250.png

Measure = 
CALCULATE (
    COUNTROWS ( 'Table' ),
    ALLEXCEPT ( 'Table', 'Table'[Concatenated] )
)

Then I create two new tables and it will give you what you want.

GroupedTable =
SUMMARIZE (
    'Table',
    'Table'[ITEM1],
    "ConcatenatedActs", CONCATENATEX ( 'Table', 'Table'[Concatenated], ", " )
)

vyilongmsft_2-1727060911261.png

Top5Concatenations =
TOPN (
    5,
    SUMMARIZE ( 'Table', 'Table'[Concatenated], "Count", 'Table'[Measure] ),
    [Count], DESC
)

vyilongmsft_3-1727060956160.png

 

 

 

Best Regards

Yilong Zhou

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

4 REPLIES 4
Anonymous
Not applicable

Hi @chock974 ,

I create a table as you mentioned.

vyilongmsft_0-1727060750398.png

Next I create a calculated column and a measure.

Concatenated = 'Table'[ACTE] & " " & 'Table'[COEFF]

vyilongmsft_1-1727060789250.png

Measure = 
CALCULATE (
    COUNTROWS ( 'Table' ),
    ALLEXCEPT ( 'Table', 'Table'[Concatenated] )
)

Then I create two new tables and it will give you what you want.

GroupedTable =
SUMMARIZE (
    'Table',
    'Table'[ITEM1],
    "ConcatenatedActs", CONCATENATEX ( 'Table', 'Table'[Concatenated], ", " )
)

vyilongmsft_2-1727060911261.png

Top5Concatenations =
TOPN (
    5,
    SUMMARIZE ( 'Table', 'Table'[Concatenated], "Count", 'Table'[Measure] ),
    [Count], DESC
)

vyilongmsft_3-1727060956160.png

 

 

 

Best Regards

Yilong Zhou

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

Almost a good solution

i try our idea with table and i have got the solution

 

and i try to do the same thing only in measure and the result is wrong.

it's my pbix to upload here : TOPN and CONCAT BY MEASURE 

chock974
Frequent Visitor
bhanu_gautam
Super User
Super User

@chock974 , Can you share data in a format that can be copied instead of picture




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






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