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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
elcamino
Frequent Visitor

Agregate distinctive values of one column sorted by another one

Hello everybody,

 

I have this table, let's call it table1. I want to create a new column, that I called column_that_I_want. This column should aggregate the distinctive Rates per Code, and should be sorted by Type. Therefore, if for the same code i have 2 different Rates, such as 7 and 2, these should be agregrated and separated by a comma and in percentage format. Additionally, the order they appear should depend on the values of Type. If Type is 2 for Rate 2 and code 1, and if Type is 1 for Rate 7 and code 1, the order should be 7.00%, 2.00%.

 

Thanks in advance

 

 

elcamino_0-1741874194513.png

 

1 ACCEPTED SOLUTION
elcamino
Frequent Visitor

I was able to solve it 

column_that_I_want =
VAR CurrentCode = Table1[Code]
RETURN
CONCATENATEX(
FILTER(
SUMMARIZE(
Table1,

Table1[Code],
Table1[Rate],
Table1[Type]
),
Table1[Code] = CurrentCode
),
FORMAT(Table1[Rate], "0.00%"),
", ",
Table1[Type],
ASC
)

View solution in original post

3 REPLIES 3
elcamino
Frequent Visitor

I was able to solve it 

column_that_I_want =
VAR CurrentCode = Table1[Code]
RETURN
CONCATENATEX(
FILTER(
SUMMARIZE(
Table1,

Table1[Code],
Table1[Rate],
Table1[Type]
),
Table1[Code] = CurrentCode
),
FORMAT(Table1[Rate], "0.00%"),
", ",
Table1[Type],
ASC
)

Anonymous
Not applicable

Hi @elcamino ,

 

If the problem has been solved, please consider accepting your response as a solution, which will help more people in need.

 

 

Best regards,

Mengmeng Li

Thanks.

 

Done.

 

Best regards

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors