Customizing Default Values for each User in Power BI (38:40)
https://www.sqlbi.com/articles/customizing-default-values-for-each-user-in-power-bi-reports/
Uses DATATABLE to create the default tables for Country/User and Calendar Year/User. Many-to-many relationships between default tables and dimension. Default table filters the dimension, 1-way. The logic is to check if Country or Calendar year is flitered outside of the visual; i.e. the matrix in this case. The Country or Calendar Year may be crossfiltered in the viual; e.g. Country is on the columns. We need to check if it's crossfiltered by for example a slicer. Use IF ( CALCULATE(ISCROSSFILTERED(Store[CountryRegion], ALLSELECTED()), ... -- -- If there is only one column used for the default value, then -- it is enough to apply the filter on the default value table and filter -- it with USERPRINCIPALNAME. The filter propagates to the related table and applies -- the default filtering. -- IF ( CALCULATE ( NOT ISCROSSFILTERED ( Store[CountryRegion] ), ALLSELECTED () ), CALCULATE ( SELECTEDMEASURE (), DefaultCountry[User] = USERPRINCIPALNAME () ), SELECTEDMEASURE () )
Comments
Post a Comment