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
ALVMRB
New Member

Table organisation and row elimination

Hi everyone I have the next data :

JON0
MAR1
JUAN0
ALF1
ALF1
PEP0
PEP0
VA0
VA0
PA0
PA1
CTA1
CTA1
AR0
NSA1
NSA1

 

I would like to do the next things: eliminate rows with 0 and eliminate rows that have a repeated name, I´ve tried many ways in different order. However, I don´t have a effective way, I would be please if some helped me to solve this problem.

Thanks for reading

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8vL3U9JRMlCK1YlW8nUMArINwWyvUEeEhKOPG1wCmR3gGgBXg8wOc8TGDEBjQsxwDsHOBrsFotovGCEMZ8cCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Item = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Item", type text}, {"Value", Int64.Type}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Value] <> 0)),
    #"Removed Duplicates" = Table.Distinct(#"Filtered Rows", {"Item"})
in
    #"Removed Duplicates"

 

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the Source step with your own source.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8vL3U9JRMlCK1YlW8nUMArINwWyvUEeEhKOPG1wCmR3gGgBXg8wOc8TGDEBjQsxwDsHOBrsFotovGCEMZ8cCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Item = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Item", type text}, {"Value", Int64.Type}}),
    #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Value] <> 0)),
    #"Removed Duplicates" = Table.Distinct(#"Filtered Rows", {"Item"})
in
    #"Removed Duplicates"

 

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the Source step with your own source.

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.