Forum Discussion
Previous period
- 2 years ago
In your Advanced Editor, Delete all other existing lines aftrer #"Added Custom3". Use these 3 lines after #"Added Custom3" step.
CurrentWeek = #"Added Custom3"[Period]{List.PositionOf(#"Added Custom3"[Current week], true)} - 1, #"Added Custom" = Table.AddColumn(#"Added Custom3", "Previous period", each [Period] = CurrentWeek) in #"Added Custom"
Click on Custom Column in Add Column menu and paste the formula which I have given. Replace #"Changed Type" with #"Added Custom3". This will become
#"Added Custom3"[Period]{List.PositionOf(#"Added Custom3"[Current week], true)} - 1Vijay_A_Verma ok, this what I get:
But this is what I want, so I can use a filter on true or false in the previous period column.
- Vijay_A_Verma2 years agoMost Valuable Professional
Have you paste the query properly which I had given? See below, you will exactly get the same output which you are asking.
- Tinus19052 years agoResolver I
Vijay_A_Verma ah I forgot the first "period". But I have a little problem with my dataset.
I have a table with +- 80.000 rows and with this formula it is loading and loading and loading for hours.
Is there an other formula for this. I dont mind if its a column with true, false, 1 ,2 etc. I only want to filter so that the period is the previous period.
- Vijay_A_Verma2 years agoMost Valuable Professional
In your Advanced Editor, Delete all other existing lines aftrer #"Added Custom3". Use these 3 lines after #"Added Custom3" step.
CurrentWeek = #"Added Custom3"[Period]{List.PositionOf(#"Added Custom3"[Current week], true)} - 1, #"Added Custom" = Table.AddColumn(#"Added Custom3", "Previous period", each [Period] = CurrentWeek) in #"Added Custom"