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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
space83
Helper IV
Helper IV

group and display all data in 1 row

Hi guys below is example of my dataset.

 

group_PN.jpg

how can I group the Part Number and at the same time the UOM data will show at another new column.

 

as example in data red crop above, the new UOM column will display ROLL, METER (in 1 line)

 

in msssql it can be done by using STUFF, but in DAX I dont know how.

2 ACCEPTED SOLUTIONS
Icey
Community Support
Community Support

Hi @space83 ,

 

Please let us know if what @Jimmy801 provides is what you want.

 

If it is, please always accept his reply as solution to your question so that people who may have the same question can get the solution directly.

 

If not, please let me know.

 

In addition, you can also create a calculated column or a measure like below:

Column = 
CONCATENATEX (
    FILTER (
        'Query1 (3)',
        'Query1 (3)'[Part Number] = EARLIER ( 'Query1 (3)'[Part Number] )
    ),
    [UOM],
    ", "
)

column.JPG

 

Measure = 
CONCATENATEX ( VALUES ( 'Query1 (3)'[UOM] ), [UOM], ", " )

measure.JPG

 

Best Regards,

Icey

View solution in original post

space83
Helper IV
Helper IV

Thanks everyone, finally I got what I want. The result I expect is below:

output.jpg

 

to achieve this, I just simply create a measure as below and thats it, done.

Measure = 
CONCATENATEX (
VALUES ( Append1[UOM] ),
Append1[UOM] ,
", "
)

 

View solution in original post

3 REPLIES 3
space83
Helper IV
Helper IV

Thanks everyone, finally I got what I want. The result I expect is below:

output.jpg

 

to achieve this, I just simply create a measure as below and thats it, done.

Measure = 
CONCATENATEX (
VALUES ( Append1[UOM] ),
Append1[UOM] ,
", "
)

 

Icey
Community Support
Community Support

Hi @space83 ,

 

Please let us know if what @Jimmy801 provides is what you want.

 

If it is, please always accept his reply as solution to your question so that people who may have the same question can get the solution directly.

 

If not, please let me know.

 

In addition, you can also create a calculated column or a measure like below:

Column = 
CONCATENATEX (
    FILTER (
        'Query1 (3)',
        'Query1 (3)'[Part Number] = EARLIER ( 'Query1 (3)'[Part Number] )
    ),
    [UOM],
    ", "
)

column.JPG

 

Measure = 
CONCATENATEX ( VALUES ( 'Query1 (3)'[UOM] ), [UOM], ", " )

measure.JPG

 

Best Regards,

Icey

Jimmy801
Community Champion
Community Champion

Hello @space83 

 

you can use Table.Group and use 1 function, that combines the column "UOM". Here a practicable example

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUQrKz8lRitWBcHJTS1KLwDwjIK8ktbgEzDEGckzBLBMgKzEpGc5OSU0Ds02B7HSl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Part Number" = _t, UOM = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Part Number", Int64.Type}, {"UOM", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Part Number"}, {{"Uom combined", each Text.Combine(_[UOM], ", "), type text}})
in
    #"Grouped Rows"

 

Jimmy801_0-1608198459548.png

Copy paste this code to the advanced editor in a new blank query to see how the solution works.

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors