Forum Discussion
jb123
9 years agoFrequent Visitor
Add column for Last Week to table
Hi, I want to add a custom column to a table that will list the words Last Week. I want to add this column so I can add slicer to the report so the users can filter to see just last week's data....
Vvelarde
9 years agoCommunity Champion
Hi, add a custom Column:
= Table.AddColumn(#"YourPreviousStep", "LastWeek", each if Date.IsInPreviousWeek([Date]) then "Yes" else "No")
rahulv
9 years agoRegular Visitor
Hi buddy,
I have the same doubt but since I am pretty new to Power BI, please explain this formula a bit more.
Like what is Table.Addcolum etc.
Please help!
Regards
Rahul
- Vvelarde9 years agoCommunity Champion
Hi, This can do in Query Editor using Power Query Langauge.
= Table.AddColumn(#"YourPreviousStep", "LastWeek", each if Date.IsInPreviousWeek([Date]) then "Yes" else "No")
In this case the sentence do:
Add a Column named "LastWeek" and fill with if Date is in Previous Week Put Yes else No.
Also you can create with Add Custom Column with this code: