Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Show Current Logged in User data only

Hello Folks,   I am new to DAX query in Power BI and struggling to use SelectedValue - any other ways would do as well.   The requirement is to show the data as per the Current Logged In User - i...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Got the solution and credit goes to miguelarce 
    https://community.powerbi.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/329584


    Measure1
    WhoIsWatching = USERPRINCIPALNAME() 
    (that is email style usernames, or you can use USERNAME() for windows style users)

     


    Measure 2
    FilterByViewer = IF(selectedvalue(table[email])=[WhoIsWatching],1,0)

     


    Drag Measure 2 as a filter for visual, select advanced filtering and set it to 
    "Show items when value IS 1"