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
PiyushBQ
Helper I
Helper I

Find Missing Values

Hi Guys,

I'm trying to identify missing cells in between a series, while ignoring empty fields that don't belong to any series.

Basically, if an empty cell has values filled in adjacent fields, it should get detected. Whereas, empty cells that don't have values in adjacent fields should get ignored.

Capture.PNG

The source file.

I have to solve this using the Query Editor.

Any ideas on how to go on about it?

Thanks!

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @PiyushBQ,

You can take a look at the following formula to create a custom column to store all missed fields:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZVBJDgMhDPsL5x7iLIQc2z5jNP//RomZWyUUyxDbCdc13uM1IEt0Y4Uv0iRdBt+QS6QZ1BpkZUNVtALBN/PnMqm3MKLUbIyQakRQtOHpQ/m4X9f4bPZ/MHsKpD+0nBW7KtpQORFmmyqjtISvQtsvQ5O7JFjj7NdOZU08GILFSZ8MTRorv2OangGmd084Tgs3jiNzG/f9Aw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Item = _t, #"Q3 2014" = _t, #"Q4 2014" = _t, #"Q1 2015" = _t, #"Q2 2015" = _t, #"Q3 2015" = _t, #"Q4 2015" = _t, #"Q1 2016" = _t, #"Q2 2016" = _t, #"Q3 2016" = _t, #"Q4 2016" = _t, #"Q1 2017" = _t, #"Q2 2017" = _t, #"Q3 2017" = _t, #"Q4 2017" = _t, #"Q1 2018" = _t, #"Q2 2018" = _t, #"Q3 2018" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Item", type text}, {"Q3 2014", Int64.Type}, {"Q4 2014", Int64.Type}, {"Q1 2015", Int64.Type}, {"Q2 2015", Int64.Type}, {"Q3 2015", Int64.Type}, {"Q4 2015", Int64.Type}, {"Q1 2016", Int64.Type}, {"Q2 2016", Int64.Type}, {"Q3 2016", Int64.Type}, {"Q4 2016", Int64.Type}, {"Q1 2017", Int64.Type}, {"Q2 2017", Int64.Type}, {"Q3 2017", Int64.Type}, {"Q4 2017", Int64.Type}, {"Q1 2018", Int64.Type}, {"Q2 2018", Int64.Type}, {"Q3 2018", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Missed", each List.Combine(Table.SelectRows(Table.Group(Table.AddColumn(Table.FromList(Table.SelectRows(Record.ToTable(_),each [Value]=null)[Name]),"Year",each Text.End([Column1],4)), {"Year"}, {{"Contents", each _[Column1], type list}}),each List.Count([Contents])<4)[Contents])),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Missed", each Text.Combine(List.Transform(_, Text.From), ","), type text})
in
    #"Extracted Values"

1.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @PiyushBQ,

You can take a look at the following formula to create a custom column to store all missed fields:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("ZVBJDgMhDPsL5x7iLIQc2z5jNP//RomZWyUUyxDbCdc13uM1IEt0Y4Uv0iRdBt+QS6QZ1BpkZUNVtALBN/PnMqm3MKLUbIyQakRQtOHpQ/m4X9f4bPZ/MHsKpD+0nBW7KtpQORFmmyqjtISvQtsvQ5O7JFjj7NdOZU08GILFSZ8MTRorv2OangGmd084Tgs3jiNzG/f9Aw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Item = _t, #"Q3 2014" = _t, #"Q4 2014" = _t, #"Q1 2015" = _t, #"Q2 2015" = _t, #"Q3 2015" = _t, #"Q4 2015" = _t, #"Q1 2016" = _t, #"Q2 2016" = _t, #"Q3 2016" = _t, #"Q4 2016" = _t, #"Q1 2017" = _t, #"Q2 2017" = _t, #"Q3 2017" = _t, #"Q4 2017" = _t, #"Q1 2018" = _t, #"Q2 2018" = _t, #"Q3 2018" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Item", type text}, {"Q3 2014", Int64.Type}, {"Q4 2014", Int64.Type}, {"Q1 2015", Int64.Type}, {"Q2 2015", Int64.Type}, {"Q3 2015", Int64.Type}, {"Q4 2015", Int64.Type}, {"Q1 2016", Int64.Type}, {"Q2 2016", Int64.Type}, {"Q3 2016", Int64.Type}, {"Q4 2016", Int64.Type}, {"Q1 2017", Int64.Type}, {"Q2 2017", Int64.Type}, {"Q3 2017", Int64.Type}, {"Q4 2017", Int64.Type}, {"Q1 2018", Int64.Type}, {"Q2 2018", Int64.Type}, {"Q3 2018", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Missed", each List.Combine(Table.SelectRows(Table.Group(Table.AddColumn(Table.FromList(Table.SelectRows(Record.ToTable(_),each [Value]=null)[Name]),"Year",each Text.End([Column1],4)), {"Year"}, {{"Contents", each _[Column1], type list}}),each List.Count([Contents])<4)[Contents])),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Missed", each Text.Combine(List.Transform(_, Text.From), ","), type text})
in
    #"Extracted Values"

1.png

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.