Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Using If to prevent a table displaying

Hi   I am running a report which raw data is added to every 5 weeks. That data is then manipulated into a cumulative totals table to calculate the number of incidents per person per block to enable...
  • Anonymous's avatar
    Anonymous
    6 years ago

    I have come up with this.  It seesm to work but doesn't auto refresh.  

     

    Any ideas of a better way to do this?

     

    let
    Source = Excel.CurrentWorkbook(){[Name="Cum_Total"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"UPN", type text}, {"Block", Int64.Type}, {"PP", type text}, {"Year", type text}, {"Count", Int64.Type}}),
    #"Removed Rows" = Table.Skip(#"Changed Type", each ([Block] = 1 or [Block] = 2 or [Block] = 3 or [Block] = 4 or [Block] = 5)),
    #"Filtered Rows" = Table.SelectRows(#"Removed Rows", each ([Block] = 1 or [Block] = 2 or [Block] = 3 or [Block] = 4 or [Block] = 5 or [Block] = 6)),
    #"Grouped Rows" = Table.Group(#"Filtered Rows", {"UPN", "PP", "Year"}, {{"Count", each List.Sum([Count]), type number}})

    in
    #"Grouped Rows"

     

    Thanks