Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
dorku
Frequent Visitor

Default Filter Based on Logged-in User Fails to Work Without Manual Interaction

Hi everyone,

I'm trying to implement user-specific default filtering in my Power BI report based on the logged-in user's email address.

 

What I want to achieve:

I want each user to see a specific default view (filtered dataset) based on a value from a user table (DIM_USERNAME_SF). This is not related to row-level security – it's simply to show a filtered page relevant to the user by default, without needing any manual filtering.

 

My setup:

  • I have a table DIM_USERNAME_SF that contains user emails and a column called ALLOWED, which stores a value (e.g., unit number) specific to each user.

  • The main data table (v_SLA_SF) includes a column called MOKED, which should match the ALLOWED value from the user table.

  • I created a measure to check if the current row matches the logged-in user's allowed value. Here's the DAX:

userUnitFlag :=
VAR UserEmail = USERPRINCIPALNAME()
VAR UserAllowedUnit =
CALCULATE(
MAX(DIM_USERNAME_SF[ALLOWED]),
FILTER(DIM_USERNAME_SF, DIM_USERNAME_SF[EMAIL] = UserEmail)
)
RETURN
IF (UserAllowedUnit = MAX(v_SLA_SF[MOKED]), 1, 0)

 

This measure works only if I manually apply a visual filter using userUnitFlag = 1.

However, if I try to use this logic to filter visuals dynamically (i.e., without user interaction), the visual displays blank. It seems the DAX is not triggering correctly unless the filter is explicitly set by the user via the slicer or visual-level filter panel.

 

About the relationship:

 

  • There is no active relationship between DIM_USERNAME_SF and v_SLA_SF, as I'm using a calculated measure instead of a column.

  • I prefer not to use row-level security or dynamic parameters – I simply want the report to behave as if the filter was already applied when the user opens it.

 

 

My question:

Is there a way to apply this kind of user-based filtering automatically, using just DAX and a user table (without RLS), so that the visuals display the right data by default?

Any ideas on how to make this logic apply without needing manual interaction?

Thank you!

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can use the technique described in https://www.sqlbi.com/articles/customizing-default-values-for-each-user-in-power-bi-reports/ to set default values per user while still allowing them to override the defaults if they so choose.

View solution in original post

5 REPLIES 5
v-csrikanth
Community Support
Community Support

Hi @dorku 

Thank you for being part of the Microsoft Fabric Community.

As highlighted by @johnt75 , the proposed approach appears to effectively address your requirements. Could you please confirm if your issue has been resolved?
If you are still facing any challenges, kindly provide further details, and we will be happy to assist you.

If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.

i did, thank you very much for your help

johnt75
Super User
Super User

You can use the technique described in https://www.sqlbi.com/articles/customizing-default-values-for-each-user-in-power-bi-reports/ to set default values per user while still allowing them to override the defaults if they so choose.

bhanu_gautam
Super User
Super User

@dorku You already have a measure userUnitFlag that checks if the current row matches the logged-in user's allowed value. Ensure this measure is correctly defined as follows:

dax
userUnitFlag :=
VAR UserEmail = USERPRINCIPALNAME()
VAR UserAllowedUnit =
CALCULATE(
MAX(DIM_USERNAME_SF[ALLOWED]),
FILTER(DIM_USERNAME_SF, DIM_USERNAME_SF[EMAIL] = UserEmail)
)
RETURN
IF (UserAllowedUnit = MAX(v_SLA_SF[MOKED]), 1, 0)

 

Since you want the filter to be applied automatically, you need to set this measure as a filter on all relevant visuals. Here’s how you can do it:

Go to each visual where you want the filter to be applied.
In the Visualizations pane, drag the userUnitFlag measure to the Filters on this visual section.
Set the filter condition to userUnitFlag is equal to 1.

 

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hi, thank you for your help!

As I mentioned earlier, the issue is that when I apply the userUnitFlag = 1 filter directly to the visual, the entire chart becomes blank — completely white, with no data at all.

The strange part is that this doesn’t happen when I apply the same filter manually through a slicer or interactively from outside the visual. In that case, it works just fine.

I’m wondering if this might be related to the fact that I’m using a live connection to a Tabular model, but I’m not entirely sure. Any ideas?

Thanks again!

dorku_0-1745391059732.png

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.