Forum Discussion
Andrewdj
3 years agoFrequent Visitor
Power Bi - Remove Null Rows when another value aleady exists
I'm working in Power BI and I have the below table of how it is and how I want it to look, with the highlighted green cells what I'm looking to change: I want to fill in the null values ...
- 3 years ago
Hi,
this M code works
let Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content], #"Grouped Rows" = Table.Group(Source, {"Name"}, {{"All", each _, type table [Name=nullable text, Company=nullable text, Sales=nullable number]}}), Custom1 = Table.TransformColumns(#"Grouped Rows", {"All", each Table.FillUp(_,{"Company"})}), #"Expanded All" = Table.ExpandTableColumn(Custom1, "All", {"Company", "Sales"}, {"Company", "Sales"}), #"Changed Type" = Table.TransformColumnTypes(#"Expanded All",{{"Name", type text}, {"Company", type text}, {"Sales", Int64.Type}}) in #"Changed Type"Hope this helps.
Ashish_Mathur
3 years agoSuper User
Hi,
this M code works
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Grouped Rows" = Table.Group(Source, {"Name"}, {{"All", each _, type table [Name=nullable text, Company=nullable text, Sales=nullable number]}}),
Custom1 = Table.TransformColumns(#"Grouped Rows", {"All", each Table.FillUp(_,{"Company"})}),
#"Expanded All" = Table.ExpandTableColumn(Custom1, "All", {"Company", "Sales"}, {"Company", "Sales"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded All",{{"Name", type text}, {"Company", type text}, {"Sales", Int64.Type}})
in
#"Changed Type"
Hope this helps.