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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
kaye_812
Frequent Visitor

Merge rows based on the other column but do not combine rows that have different values in other col

I may have worded my problem really bad but it's really hard to explain. This representation might help. The table below is what I want it to look like. Thank you!

IMG_20230717_102953.jpg

11 REPLIES 11
AlexisOlson
Super User
Super User

Try the solution here:
https://community.fabric.microsoft.com/t5/Desktop/TRICKY-Move-cell-up-in-certain-columns/m-p/2158720

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXJKTAeSIBSrAxEJSM1LzsyBCIaU5iblpBbB5UBCiQWpyMqRhWIB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Number = _t, #"Content 1" = _t, #"Content 2" = _t, #"Content 3" = _t]),
    #"Replaced Value" = Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue,{"Content 1", "Content 2", "Content 3"}),
    Custom1 = Table.FromColumns(List.Transform(Table.ToColumns(#"Replaced Value"), List.RemoveNulls), Table.ColumnNames(#"Replaced Value")),
    #"Filtered Rows" = Table.SelectRows(Custom1, each List.NonNullCount(Record.ToList(_)) > 1)
in
    #"Filtered Rows"

 

rubayatyasmin
Super User
Super User

Hi, @kaye_812 

 

For Content 1 column: Remove the null values. (by simply opening the table in power query and filter out the nulls)

 

For content 2 column: Replace null with Tape

 For content 3 column: Replace null with Tumbler

 

hope this helps. 

 

If my assistance helps you in any way, hit 👍 and accept the answer as a solution. 

 

Thanks


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Hi, there are other values in Number Column which may also have other values for the conten1, 2, and 3 columns. I can't just simply change null values. Please see attached photo

IMG_20230717_134345.jpg

May I know if content 2 and 3 column value is coming from another table or not? As you mentioned something about the merge. 


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


No, they're not. This is the only table I have. 

What I want to happen, basically, is to merge rows but on the other hand, keep rows with the same Number column value separate if they completely have unique values from columns Content 1, Content 2, Content 3. The null values must also be populated if there exists a value in a column corresponding to the Number

Can you try group by on Number and then Fill function? See if that works. 

If my assistance helped you in any way, appreciate the kudos. 

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


It doesn't work 😞 

Here's updated table to illustrate more my case 

IMG_20230717_141652.jpg

Sorry, I tried some possible solutions but couldn't achieve output like yours. 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Would you know any way to go about this?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.