Forum Discussion
Clearing a slicer value
- 6 years ago
Hi Anonymous ,
maybe this helps to create a default filter element, what is always valid.
It sounds like there isn't a solution to this problem. I don't have a date table anywhere in the model as different report pages pull from different tables. The different tables either are daily or week ending and as such, there isn't a consolidated date table.
Calculated columns are not an option on a live connection for us either.
Finally, I created a table with 4 columns, the end of week date, a number, a flag for Prior week where it was a true/false value if the end of the week was last week. To simulate this scenario of someone looking at it last week and then looking at it this week. So I selected, week ending 23 May 2020 for when they looked at it last week. Then I filtered the slicer on the flag where it was true. I still had 23 May 2020 in the selection list and it was the selected value. When I selected 30 May 2020, 23 May went away.
It looks like it's a 'by design' thing with slicers that if the values in the slicer are no longer valid then it still stays selected. I've noticed this in the past where I have a slicer which only displays the weeks where a widget was sold. In the case where I looked for widget A, I could get 1/1/2020, 1/8/2020, 1/15/20, and select 1/8/2020. When I select widget B, and it only sold on the week ending 1/15/2020, 1/8/2020 is still selected in the filter, but it's not a valid date as evidenced when I clear the selection.
I'll mark your last reply as a solution unless Microsoft as a better answer, I'll just consider it another limitation in the tool - I mean seriously how hard is it to add a property to the card visualization so when it would return (blank) you could have it put something else in without you having to write a measure and take additional cycle time.
Thanks again.
Anonymous - why would you not have a date table? You just link the date to every date field in your model (or at least 1 per table) and it doesn't matter if it is a day, week ending date, or month ending date. It units the model and allows you to control any aspect of the model via date from one place.
- Anonymous6 years agoNot applicable
Various articles point to the performance impact of creating/having date tables as they contain every date from the minimum to the maximum by day. That is, if I have issues created in 2016 in the model ending in 2020, we have 1600 records, and growing every day.
Additionally, if a table has multiple dates (let's say a trouble ticket system) including issue creation, last modified, first worked, resolved, wouldn't you need to create a relationship between the date table and each of those fields to use to slice the data? Since last modified is a date and time field, wouldn't your date table then also include the time in case you wanted to see what was modified during a work day from 6/2/2020 8:00 to 6/2/2020 17:00?
Finally, linking the date table and, if I am getting you correctly, having a single filter to control the date range, the system wouldn't know - from a single table - what field from the issue table to reference. If I used a slicer against the date table, how would it know if I wanted to use the range 5/24/2020 -> 5/30/2020 on the created, resolved, or modified field.
Maybe I'm not understanding the benefits of a date table, but it's one of the listed ways to improve performance from a number of sites. I don't know enough, with regards to the benefits, for me to implement it in a way that is beneficial; especially if I have multiple date fields in a record.
- mwegener6 years agoMost Valuable Professional
- edhans6 years agoCommunity Champion
Anonymous - that is if you use CALENDARAUTO() which you should never do. Date Tables should be created in Power Query. Below is a link to an blog post I wrote that will let you create a dynamic date table that will move and expand with the relevant dates in your model, not all of the dates.
Any article that argues against a date table because it has 4 years of dates really doesn't understand what it is talking about. 1,600 rows in Power BI is nothing. The issue is when you use CalendarAuto and some table has a fake expiration date of Dec 31, 9999. Then you get 2.9 million records. That is a problem.
Here is an article that covers some basics of why a date table should be used. You generally never want to put dates from your FACT tables or other DIM tables in visuals. Always use the linked date from the date table. in fact, I most often hide those other date fields so I don't accidentally use them.
- Anonymous6 years agoNot applicable
https://adatis.co.uk/top-10-power-bi-performance-tips-part-2/
I liked the point on the inactive relationships by the other poster, I didn't even know that was an option, I'd be curious as to the performance impact.
I can't appropriately explain the model we use as I don't have the correct words, but I don't think we use a 'true' fact/dim model as we have normal people developing reports off of the source and it's not intuitive to a non-developer how to create visuals. So a lot of our tables are 'result' table and they can use the dim table for filtering, but the 'report' tables include some of the data from the dim tables.
And I have no idea what you mean by "never want to put dates from your FACT tables or other DIM tables in visuals" as fact tables include things like create_dt, last_modified_dt, sales_dt, etc. If all of those values were in a Dim table, then I would have 5.23 million rows in that table - I just ran a count distinct on the last modified date in our table.