Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello everyone!
Interesting question. I think it's not possible to execute this on power bi at the moment, but let's give it a try.
My report filters based on username already. I have a table for user information. Including their country.
Is it possible to, when a user logs in from sweden, to have sweden selected by default on the country slicer? While also being able to change the country on the slicer?
I know that there is this thread on the community:
Even tho this is a great solution and a genius work around, my client is asking for to select the country and not some alternative "name" for it, like "current country".
Thank you !
Alena
Hi @alenashkel ,
If you don't want to use Row Level Security (RLS), please try following steps:
This is my test table:
Please create following measures:
Current selections = COUNTROWS(DISTINCT(ALLSELECTED('Table'[Country])))
Total selections = COUNTROWS(DISTINCT(ALL('Table'[Country])))
Sales with default = IF(
[Current selections] = [Total selections],
CALCULATE(
SUM('Table'[Sales]),FILTER('Table','Table'[Country] = "Sweden")),
SUM('Table'[Sales]))
The sales and the slicer are always Sweden.
The user can be able to change the country on the slicer.
Best regards,
Yadong Fang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Plus, it's a dynamic filter. In your case, you say specfically = sweden. This would vary depending on the user.
Thank you for your reply!
I see you did an example for sum(sales)
But this won't work for the whole report. By this I mean, it's not just one measure (like sum(sales)), it's for the whole report, with a lot of measures in it.
This won't work for this case right?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
118 | |
81 | |
48 | |
37 | |
27 |
User | Count |
---|---|
185 | |
73 | |
73 | |
50 | |
42 |