Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a visual for which I automatically only want to show all days in the current calendar month until yesterday. Yes, this means that on the first day of the month you have an empty visual.
I want to do this by setting two relative filters:
- set a relative filter to this month (showing all days in this month);
- set a relative filter to last month (showing all days from a month ago to now).
This way, all days after today and days before this calendar month are excluded.
The problems comes here:
My visual is changed accordingly then. However, when I select the visual again and look at the filter settings, both filters have changed to "is in the last 30 days, including today". This is not what I selected! Although the visual is still showing the right information, I wonder what happens if we have a new day. I believe this to be a bug. Below I share a screenshot of how my filters look like after selecting the visual again, which obviously is different than the filters I just set them to a few seconds before.
Anyone knows a solution to this? I rather not do a calculated column showing whether a day is in the current month and belongs to the past days. Power BI offers relative filtering and that should work.
Solved! Go to Solution.
Hi @Anonymous
Here is a workaround.
Create measures, then add [flag] in the visual level filter
In my example, today=2019/1/25
today = TODAY() today-year = YEAR([today]) today-month = MONTH([today]) flag = IF ( MAX ( 'Table'[year] ) = [today-year] && MAX ( 'Table'[month] ) = [today-month] && MAX ( 'Table'[Date] ) < [today], 1, 0 )
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
Here is a workaround.
Create measures, then add [flag] in the visual level filter
In my example, today=2019/1/25
today = TODAY() today-year = YEAR([today]) today-month = MONTH([today]) flag = IF ( MAX ( 'Table'[year] ) = [today-year] && MAX ( 'Table'[month] ) = [today-month] && MAX ( 'Table'[Date] ) < [today], 1, 0 )
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Somehow this does not work for me. Maybe, I did something wrong. Nevertheless, I created a workaround myself by making an extra calculated column.
I was more interested why this standard functionality (using the in built relative date filtering) did not work at first hand.
Hi @Anonymous
Very interested how you created a workaround by making an extra calculated column.
As tested, if i click on the "Apply filter" after setting the relative slicer, then next time the "Apply filter" should become grey.
If i don't click on it after setting, it shows as your screenshot to be yellow.
Best Regards
Maggie
I see this problems only occurs for me in one report working on a different power BI dataset.
Both reports opened on the same computer using the same Power BI version. Any idea what might cause the relative date filtering to give problems? All relative date filters I set (no matter what I select: years, months, etc.) change to "last 30 days".
It is actually almost similar to yours so I accept it as the solution. I basically created the same thing as you but then as a column, rather than a measure:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |