Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

FIlter Current week

Hi I have a table that I want filter away before loading in power bi, I have several week of data and just want to have current week. I have only yearweek in my fact table, im using same table to se...
  • BA_Pete's avatar
    BA_Pete
    3 years ago

     

    You need to add a step name if you're putting it straight into Advanced Editor.

    It would look something like this:

    // This:
    
    let
        Source = YourSource,
        SomeChanges = Function(Source, each DoStuff)
    in
        SomeChanges
    
    // ...would go to this:
    
    let
        Source = YourSource,
        FilterRows = 
            Table.SelectRows(
                Source,
                each [YearWeek] = List.Max(Source[YearWeek])
            )
        SomeChanges = Function(FilterRows, each DoStuff)
    in
        SomeChanges
    

     

    Pete