Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
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. I haven't been able to get this working so as a workaround I created a duplicate copy of the table and in the edit query mode, I set a filter for last week. This is not ideal as I have multiple tables and would prefer to have one table and let the user filter on the date.
Thanks.
Solved! Go to Solution.
Hi, add a custom Column:
= Table.AddColumn(#"YourPreviousStep", "LastWeek", each if Date.IsInPreviousWeek([Date]) then "Yes" else "No")
Hi @jb123 ,
This is a good approach but becomes impractical when you need like combination of these kinds of filters. I had faced a similar situation previously and what we ended up doing is getting a custom visual named Date picker by Powerviz.
It had all the required features like
Multiple presets,
Default selection
Holidays
Invalid dates highlight and much more
So final result, the client was happy.
I think you should check them out.
Here is a link if you want to check this visual - https://appsource.microsoft.com/en-us/product/powerbivisuals/truvizinc1674781244292.date-picker-by-p... (I believe they offer a free version too)
Hi, add a custom Column:
= Table.AddColumn(#"YourPreviousStep", "LastWeek", each if Date.IsInPreviousWeek([Date]) then "Yes" else "No")
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
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:
This worked - thank you!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
User | Count |
---|---|
94 | |
90 | |
83 | |
76 | |
49 |
User | Count |
---|---|
145 | |
140 | |
109 | |
68 | |
55 |