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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
roscas
Helper I
Helper I

Show result in only one row

Good afternoon, I need help with the following case. If anyone could help me, I would appreciate it. I have a table where in the 'request' column there are duplicate values because there are values in different columns. What I need is to have only one row with the values from the columns. In the images, you will see what I have and the final result.

 

Result before

1.png

 final result

2.png

1 ACCEPTED SOLUTION
dufoq3
Super User
Super User

Hi @roscas,

 

Before

dufoq3_0-1714420148889.png

 

After

dufoq3_1-1714420163215.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjOxMLQwt1DSUfLKL05VCM7NLMkAcqAoVgdZBTZFcBUWBkCub2JRZqKCc0ZiWWoVFlPAauAIRTE2NeimYajBYl1sLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Request = _t, #"Policy Holder" = _t, Item1 = _t, #"Item 12" = _t, #"Item 13" = _t]),
    // You can probably delete this step.
    ReplaceBlankToNull = Table.TransformColumns(Source, {}, each if _ = "" then null else _),
    GroupedRows = Table.Group(ReplaceBlankToNull, {"Request"}, {{"All", each 
        [ a = Table.ColumnNames(_),
          b = Table.FillUp(Table.FillDown(_, a), a)
        ][b], type table}}),
    All = Table.Combine(GroupedRows[All])
in
    All

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

View solution in original post

3 REPLIES 3
dufoq3
Super User
Super User

Hi @roscas,

 

Before

dufoq3_0-1714420148889.png

 

After

dufoq3_1-1714420163215.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjOxMLQwt1DSUfLKL05VCM7NLMkAcqAoVgdZBTZFcBUWBkCub2JRZqKCc0ZiWWoVFlPAauAIRTE2NeimYajBYl1sLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Request = _t, #"Policy Holder" = _t, Item1 = _t, #"Item 12" = _t, #"Item 13" = _t]),
    // You can probably delete this step.
    ReplaceBlankToNull = Table.TransformColumns(Source, {}, each if _ = "" then null else _),
    GroupedRows = Table.Group(ReplaceBlankToNull, {"Request"}, {{"All", each 
        [ a = Table.ColumnNames(_),
          b = Table.FillUp(Table.FillDown(_, a), a)
        ][b], type table}}),
    All = Table.Combine(GroupedRows[All])
in
    All

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Thanks  for your support!!!  it's working

You're welcome.


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors