Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi Everyone,
I have a User Table mapped with their Geographic Location in Power BI. When the Individual user login to Power BI, the default slicer selection of the "Country Slicer" should be changed into the Geographic location from where he belongs to.
(Say) For Example, When the User from Sweden tries to login, the Country Slicer value should be defaulted to "Sweden" and also he should be given the flexibility to switch between the Other country values in the Slicer.
Can we achieve this in Power BI or not? If so, Please help me out in implementing this.
Thankyou all in advance!!
Solved! Go to Solution.
Hi @Anonymous
It is difficult to dynamically update the slicer value.
As a workaround, you can add one record "current login country " as below:
Slicer Table =
VAR tab =
ADDCOLUMNS (
DISTINCT ( 'Fact Table'[Country] ),
"Rank", RANKX ( DISTINCT ( 'Fact Table'[Country] ), 'Fact Table'[Country],, ASC ) + 1
)
RETURN
UNION (
tab,
DATATABLE ( "Country", STRING, "Rank", STRING, { { "Current login country", "1" } } )
)
Then create a measure and apply it to your table visual filter pane.
visual filter pane =
VAR country_slicer =
SELECTEDVALUE ( 'Slicer Table'[Country] )
VAR country_table =
SELECTEDVALUE ( 'Fact Table'[Country] )
VAR country_login =
CALCULATE (
MAX ( 'User Table'[Country] ),
FILTER ( 'User Table', 'User Table'[User] = USERPRINCIPALNAME () )
)
RETURN
IF (
ISFILTERED ( 'Slicer Table' ),
IF (
country_slicer = "Current country",
IF ( country_table = country_login, 1, 0 ),
IF ( country_table = country_slicer, 1, 0 )
),
1
)
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Just use Pre-selected filter from the market. It's free and easy to use.
Kindly accept this as the solution if it works for you. 🙂
Hi Everyone,
Still I am indeed of the help on this requirement. I can able to get the User and Location Details from the User Table using DAX. My question is How to set up the default value in the Slicers based on the geographic location of the users login to Power BI and how to dynamically update the slicer value for every user?
I wanted to know whether this is possible in Power BI or not? If so, please provide your help !!
Thanks in advance !!
Hi @Anonymous
It is difficult to dynamically update the slicer value.
As a workaround, you can add one record "current login country " as below:
Slicer Table =
VAR tab =
ADDCOLUMNS (
DISTINCT ( 'Fact Table'[Country] ),
"Rank", RANKX ( DISTINCT ( 'Fact Table'[Country] ), 'Fact Table'[Country],, ASC ) + 1
)
RETURN
UNION (
tab,
DATATABLE ( "Country", STRING, "Rank", STRING, { { "Current login country", "1" } } )
)
Then create a measure and apply it to your table visual filter pane.
visual filter pane =
VAR country_slicer =
SELECTEDVALUE ( 'Slicer Table'[Country] )
VAR country_table =
SELECTEDVALUE ( 'Fact Table'[Country] )
VAR country_login =
CALCULATE (
MAX ( 'User Table'[Country] ),
FILTER ( 'User Table', 'User Table'[User] = USERPRINCIPALNAME () )
)
RETURN
IF (
ISFILTERED ( 'Slicer Table' ),
IF (
country_slicer = "Current country",
IF ( country_table = country_login, 1, 0 ),
IF ( country_table = country_slicer, 1, 0 )
),
1
)
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Will this work? when the user multi-selected the slicer
Hi, @Anonymous
It is currently difficult for PowerBI to automatically identify the Geographic Location of the logged-in user.
You may need to create a user table that contains information such as users, tenants, and countries.
So that you can get the current user principal name and find the corresponding country in the user table to filter data.
Best Regards,
Community Support Team _ Eason
Hi @Anonymous ,
Can you attach some sample data here please in a file or may be a sample pbix file that has data within it for this scenario?
Thanks,
Pragati
Even I am looking for this feature but based on a name selection.
Can you please help?
Hello All,
Any help on the above mentioned requirement would be really helpful.
Please Let me know whether that is possible in Power BI or not.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.