Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Column with Tables, m code function problem

Hello. I have a problem. I want to extract information from the table into one cell. And I have errors like in this picture. The aim is to create a dynamic function to use in the column function Cou...
  • Anonymous's avatar
    Anonymous
    4 years ago

    I found solution: 

    (mytable as table)=> 
     
        let
         Source = Excel.Workbook(mytable, null, true),
         #"Demoted Headers" = Table.DemoteHeaders(mytable),
        #"Changed Type" = Table.TransformColumnTypes(#"Demoted Headers",{{"Column1", type text}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each #"Changed Type"{0}[Column1]),
        #"Filtered Rows" = Table.SelectRows(#"Added Custom", each Text.Contains([Column1], "2a Wentylacja mechaniczna - 5 pkt. Wszystkie ")),
        #"Counted Rows" = Table.RowCount(#"Filtered Rows")
    in
        #"Counted Rows"