Forum Discussion
Clearing a slicer value
- 6 years ago
Hi Anonymous ,
maybe this helps to create a default filter element, what is always valid.
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.
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
While I can understand your point, I believe you are missing mine, and we are way off the original question of how we clear a slicer value - that has not been resolved and doesn't appear that is can be. We can limit it as much as we want to, but nothing in the Power BI deselects slicer values that are no longer valid.
We do not have developers using Power BI in all cases; we have project managers and others who are not versed in, nor have any inclination to be, database or developers. As such, we can set up any sort of star schema we want, but it doesn't matter. We have to provide them a clear, single table to use when they are creating the reports and facilitate 'ease of use.' Trying to explain how to write measures using inactive relationships, is well beyond their skillset.
The analogy is this - in SQL Server, you have a set of dim and fact tables storing the data. The customer needs to write 10 SQL statements that always join 5 of these tables together, albeit with different where clauses. The easiest way for them to accomplish this with minimal effort on their part would be to request a view. Does this make it less efficient? Maybe, but that is what we have done for our users in this model. Can we associate that view to dim tables in the model and use that dim table for filters? Yes. Can we force them to create visualizations based on fact to dim relationships? No.
If we had a team of developers or others that could understand and use the model in that way would make life easier. However, that is not the case. I'll have to look up how we could create the measures to use the inactive relationships. Since it's a live connection model, I may be able to create the measures on that side for the inactive relationships.
As a side note, I haven't had the time to review anything you've provided before, so I apologize if anything I've said above is covered in those posts.
As people who generate the models, there is no one true way to do things. We can have our best practices and ideas, but at the end of the day, we need to provide our customers with a model they can use and understand. Education is key, but given the wide availability of the tool, sometimes we have to cut corners. With a limited amount of technically savvy team, it is not always an efficient use of our time to make the perfect model; you make a good enough model. Those reports which update twice a day, load less than 10 MB of data, and are not modified after creation, working to make the most performance efficient model is just not worth the time. For reports which update every 30 minutes, then yeah, be uber-efficient, spend the time documenting to an end-user level, or flag those as "For Developer Modification Only."
Again, I do get what you are saying, and I appreciate the education provided.
- 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.
- edhans6 years agoCommunity Champion
Anonymous Power BI is built on top of SQL Server Analysis Services - you actually launch an SSAS instance when Power BI launches on your PC.
It is optimized for a query model where the DIM tables are NOT normalized, using a Star Schema. Massive repitition in the DIM tables is fine. Segregating things out into a snowflake schema, like a normal SQL type person thinks, is not good for Power BI. It doesn't perform well. If you know SQL and are used to that, you have to unlearn that for Power BI, or you will bog down its performance. See this article for more, or look at this course and book by SQLBI.
If you cannot adequately explain your model and how it relates to a Star Schema model, you will experience problems with performance and writing measures to return what you want. It is all designed with a Star Schema: DAX, the Vertipaq engine, the tabluar model of SSAS, all of it. While you see tables, and Power BI presents tables to you, in reality, it is only dealing with columns. You can read some of the technical bits here. It is interesting to note that one of the recommendations is, always add a DATE dimension table. You don't need to understand all of it. Just know that is how it is designed, and doing it differently means it will not perform as well as it could, and it will cause you to work harder as a developer to write measures to get the visuals you want.