Forum Discussion
Dynamic Slicer to select previous week as default
- 2 years ago
That is possible but only if your Calendar table is sourced in Import Mode and is refreshed at least weekly.
Here's the standard pattern (adjust to your needs):
- create a string representation of your date column, replace the latest date with a string "Latest"
- sort that new column by the original date column
- add a slicer or visual/page/report level filter
- set the filter to "Latest"
- publish the pbix to the workspace/app - 2 years ago
I tried to add this mesure it worked fine!
cx_last_week = VAR max_date = MAX(dim_date[cx_end_of_week]) RETURN If(dim_date[cx_end_of_week] = max_date -7, "Last week", dim_date[weekly_start_monday_day_dates])Thanks for your time
That is possible but only if your Calendar table is sourced in Import Mode and is refreshed at least weekly.
Here's the standard pattern (adjust to your needs):
- create a string representation of your date column, replace the latest date with a string "Latest"
- sort that new column by the original date column
- add a slicer or visual/page/report level filter
- set the filter to "Latest"
- publish the pbix to the workspace/app
- tmhalila2 years ago
Resolver II
Thanks for your idea,
I have updated the changes with data related to my dataset and from the idea you provided I can get the current week but I want the last week before the current week. I have tried some formulas with errors.
Attached is the Power BI project.
- tmhalila2 years ago
Resolver II
I tried to add this mesure it worked fine!
cx_last_week = VAR max_date = MAX(dim_date[cx_end_of_week]) RETURN If(dim_date[cx_end_of_week] = max_date -7, "Last week", dim_date[weekly_start_monday_day_dates])Thanks for your time