<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RLS vs Filter for current user in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/329584#M9750</link>
    <description>&lt;P&gt;Environment:&amp;nbsp; SQL 2016, using Tabular models, Power BI, live connection with Tabular Models&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see a lot of people asking about filtering to "Current User", this is a simple and easy thing to do within SSRS as a hidden parameter that is filtered into the data query.&amp;nbsp; However, pretty much all of the answers are to do Row Level Security.&amp;nbsp; There is a very different need between filtering to current user and securing the data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem:&amp;nbsp; Same as a lot of people I want to create a dashboard/report where it auto filters to the current user, or at least defaults the filter to the current user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Requirement: When a user opens the Power BI dashboard/report it should filter to their stuff.&amp;nbsp; Single dashboard as this is a corporate dashboard so if things are modified it's done one time and everyone has the same view of their information.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a working version of Row Level Security on one of our Tabular Models, however this doesn't actually solve my problem.&amp;nbsp; I don't actually want to secure the data and only let the current user see their stuff.&amp;nbsp; If I were to implement RLS, then I would need 2 Tabular models on the same data, one to filter for current user and another to let them see everything if they want.&amp;nbsp; That's not a viable solution.&amp;nbsp; I found a work-around for date filtering to be current day/month/yr etc, but cannot find anything to do something similar with the current user.&amp;nbsp; I have used the USERNAME() for the RLS, however that cannot be used in a table column within the tabular model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure if having the USERNAME() function work dynamically at query time is on the roadmap of improvements or if anyone has found any other solution to get the report/dashboard to filter or default to the current user.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Dec 2017 15:48:25 GMT</pubDate>
    <dc:creator>jdbusselman</dc:creator>
    <dc:date>2017-12-27T15:48:25Z</dc:date>
    <item>
      <title>RLS vs Filter for current user</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/329584#M9750</link>
      <description>&lt;P&gt;Environment:&amp;nbsp; SQL 2016, using Tabular models, Power BI, live connection with Tabular Models&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see a lot of people asking about filtering to "Current User", this is a simple and easy thing to do within SSRS as a hidden parameter that is filtered into the data query.&amp;nbsp; However, pretty much all of the answers are to do Row Level Security.&amp;nbsp; There is a very different need between filtering to current user and securing the data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem:&amp;nbsp; Same as a lot of people I want to create a dashboard/report where it auto filters to the current user, or at least defaults the filter to the current user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Requirement: When a user opens the Power BI dashboard/report it should filter to their stuff.&amp;nbsp; Single dashboard as this is a corporate dashboard so if things are modified it's done one time and everyone has the same view of their information.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a working version of Row Level Security on one of our Tabular Models, however this doesn't actually solve my problem.&amp;nbsp; I don't actually want to secure the data and only let the current user see their stuff.&amp;nbsp; If I were to implement RLS, then I would need 2 Tabular models on the same data, one to filter for current user and another to let them see everything if they want.&amp;nbsp; That's not a viable solution.&amp;nbsp; I found a work-around for date filtering to be current day/month/yr etc, but cannot find anything to do something similar with the current user.&amp;nbsp; I have used the USERNAME() for the RLS, however that cannot be used in a table column within the tabular model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure if having the USERNAME() function work dynamically at query time is on the roadmap of improvements or if anyone has found any other solution to get the report/dashboard to filter or default to the current user.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Dec 2017 15:48:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/329584#M9750</guid>
      <dc:creator>jdbusselman</dc:creator>
      <dc:date>2017-12-27T15:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: RLS vs Filter for current user</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/329910#M9770</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/44134"&gt;@jdbusselman&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As far as I know, there is no elegant way. You may leave a comment and vote &lt;A href="https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/19963999-allow-default-filtering-based-on-current-user" target="_self"&gt;this idea&lt;/A&gt; up.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 08:48:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/329910#M9770</guid>
      <dc:creator>v-chuncz-msft</dc:creator>
      <dc:date>2017-12-28T08:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: RLS vs Filter for current user</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/496186#M15192</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/44134"&gt;@jdbusselman&lt;/a&gt;: I found this post while looking for a solution to the very same problem. I couldn't find a solution elsewhere so I tried myself and I think I found a usable workaround to achieve the desired result without having to use RLS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a table to use as a filter later on: "Filter Table" with one column, two values: "yes" and "no". I did it with M:&lt;PRE&gt;let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WikwtVorViVbyy1eKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Choice = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Choice", type text}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Choice", "Show only my stuff?"}})
in
    #"Renamed Columns"&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;Create a Measure that filters data using username():&lt;PRE&gt;# my stuff = CALCULATE(
    COUNTROWS('AllStuffTable');
    FILTER(
        ALL('AllStuffTable'[UserName]);
        'AllStuffTable'[UserName] = username()
) &lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;Create a Measure that chooses the measure above when the value "yes" is selected in the "Filter Table", otherwise show unfiltered data:&lt;BR /&gt;&lt;PRE&gt;# stuff = 
SWITCH (
    SELECTEDVALUE ( 'Filter Table'[Show only my stuff?] );
    "yes"; [# my stuff)];
    COUNTROWS ( 'AllStuffTable')
)&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;Create a data table with all desired fields an add the "# stuff" measure. By default, tables don't show rows where all measures are BLANK. We can use that, because for data that is not "my stuff" the measure "# stuff" will be BLANK and therefore excluded from the table.&lt;/LI&gt;&lt;LI&gt;When filtering the "Filter Table" to "yes" or "no" you will see a filtered result in the data table or not. You could&amp;nbsp;put the filter in the filter pane or as a slicer on the canvas for user to switch to "their stuff" an back.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Does that make sense?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Aug 2018 12:16:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/496186#M15192</guid>
      <dc:creator>Sokon</dc:creator>
      <dc:date>2018-08-22T12:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: RLS vs Filter for current user</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/541601#M16800</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/7023"&gt;@Sokon&lt;/a&gt;&amp;nbsp;Do you have a pbi example to share as i do not succeed in implementing your solution ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stephane&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2018 15:53:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/541601#M16800</guid>
      <dc:creator>DooDoo</dc:creator>
      <dc:date>2018-10-14T15:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: RLS vs Filter for current user</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/732948#M19889</link>
      <description>&lt;P&gt;Measure1&lt;BR /&gt;WhoIsWatching = USERPRINCIPALNAME()&amp;nbsp;&lt;BR /&gt;(that is email style usernames, or you can use USERNAME() for windows style users)&lt;BR /&gt;&lt;BR /&gt;Measure 2&lt;BR /&gt;FilterByViewer = IF(selectedvalue(table[email])=[WhoIsWatching],1,0)&lt;BR /&gt;&lt;BR /&gt;Drag Measure 2 as a filter for visual, select advanced filtering and set it to&amp;nbsp;&lt;BR /&gt;"Show items when value IS 1"&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 16:21:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/732948#M19889</guid>
      <dc:creator>miguelarce</dc:creator>
      <dc:date>2019-07-05T16:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: RLS vs Filter for current user</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/2077787#M31772</link>
      <description>&lt;P&gt;Yet again the solution is there is no solution, please upvote. Well done all round clap clap&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 12:58:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/2077787#M31772</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-15T12:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: RLS vs Filter for current user</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/2077795#M31773</link>
      <description>&lt;P&gt;Could I suggest having another status of Unresolvable? It saves me having to read through all the comments before I realise I'm completely wastiung my time&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 13:00:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/2077795#M31773</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-15T13:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: RLS vs Filter for current user</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/2222095#M33299</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/142243"&gt;@miguelarce&lt;/a&gt;&amp;nbsp;- this saved some time &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Show-Current-Logged-in-User-data-only/m-p/2219446/thread-id/810376#M811109" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Show-Current-Logged-in-User-data-only/m-p/2219446/thread-id/810376#M811109&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 06:17:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/RLS-vs-Filter-for-current-user/m-p/2222095#M33299</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-06T06:17:16Z</dc:date>
    </item>
  </channel>
</rss>

