Forum Discussion
Anonymous
3 years agoNot applicable
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...
- 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 SomeChangesPete
BA_Pete
3 years agoSuper User
Hi Anonymous ,
If your YearWeek column is an integer e.g. 202301, 202341 etc. then the following filter should work:
Table.SelectRows(
previousStepName,
each [YearWeek] = List.Max(previousStepName[YearWeek])
)
Pete
Anonymous
3 years agoNot applicable
Hi got this when try to add it in Advanced editor
Table.SelectRows( (Token '=' expected.)
previousStepName,
each [YearWeek] = List.Max(previousStepName[YearWeek])
Regard
- BA_Pete3 years agoSuper User
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 SomeChangesPete