<?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 Re: How to dynamically filter the whole fact table based upon user selection in Slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3187159#M115436</link>
    <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Apr 2023 20:05:37 GMT</pubDate>
    <dc:creator>CNENFRNL</dc:creator>
    <dc:date>2023-04-13T20:05:37Z</dc:date>
    <item>
      <title>How to dynamically filter the whole fact table based upon user selection in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3184659#M115248</link>
      <description>&lt;P&gt;Hi, I have a dataset like the following,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Emp Code&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Employee Location&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Pool&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Billed Hours&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Total Hours&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Matt&lt;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t;/TD&gt;&lt;TD&gt;Novak&lt;/TD&gt;&lt;TD&gt;Canada&lt;/TD&gt;&lt;TD&gt;CA Bench&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;120&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;Alex&lt;/TD&gt;&lt;TD&gt;USA&lt;/TD&gt;&lt;TD&gt;CA Bench&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;120&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;Emma&lt;/TD&gt;&lt;TD&gt;USA&lt;/TD&gt;&lt;TD&gt;UK Bench&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;120&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have another Table which is as given below,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Employee Location&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Pool&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;USA&lt;/TD&gt;&lt;TD&gt;US Bench&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;USA&lt;/TD&gt;&lt;TD&gt;US State&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;UK&lt;/TD&gt;&lt;TD&gt;UK Bench&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Canada&lt;/TD&gt;&lt;TD&gt;CA Bench&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These tables can be related with each other using Employee Location (however it would create a Many-to-Many Relation)&lt;/P&gt;&lt;P&gt;I have a report like the following,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It has two Slicers on Employee Location and Pool, and three very simple measures.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want to do is actually with the help of&amp;nbsp;&lt;STRONG&gt;Employee Location Slicer,&amp;nbsp;&lt;/STRONG&gt;I want to filter the complete data. Using the second table given, if any Employee Location is selected then the corresponding&amp;nbsp;&lt;STRONG&gt;Pools&amp;nbsp;&lt;/STRONG&gt;against that Employee Location,&amp;nbsp;&lt;STRONG&gt;must be excluded from the whole report.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, for example, If I select&amp;nbsp;&lt;STRONG&gt;USA,&amp;nbsp;&lt;/STRONG&gt;I don't want to include any rows that have&amp;nbsp;&lt;STRONG&gt;Pool in {"US State", "US Bench"}. These US State and US Bench information is coming from the Other table.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;That is, following highlighted rows (Pool is highlighted) must be excluded from the table and the three measures (or from the whole dataset)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Similarly, if I select "UK" from the Employee Location, then following rows should be excluded from the whole report,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should also work with&amp;nbsp;&lt;STRONG&gt;Multi-Select in the Slicer.&amp;nbsp;&lt;/STRONG&gt;So, If I select &lt;STRONG&gt;UK and USA&amp;nbsp;&lt;/STRONG&gt;from the Slicer, then the following rows must be excluded from the Final Result&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and if no slicer is selected (that is Employee Location is ALL then no row should be excluded. This can be very easily achieved using&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;ISFILTERED&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;function but I can't seem to get how can I achieve the other conditions)&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to apply a Measure at Page Level or on All Pages level but that doesn't work. Can anyone help me out in this, please? Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt;If you would like to download the Power BI File, then you may do so from here:&amp;nbsp;&lt;A href="https://drive.google.com/file/d/1kmyw9SxKvzy7-QQDLl5nJ7xsJSwBpQKh/view?usp=sharing" target="_blank" rel="noopener"&gt;https://drive.google.com/file/d/1kmyw9SxKvzy7-QQDLl5nJ7xsJSwBpQKh/view?usp=sharing&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 17:11:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3184659#M115248</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-12T17:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically filter the whole fact table based upon user selection in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3184725#M115256</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;place the following measure in the filter pane of the table visual. Select "is not blank" then apply the filter&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FilterMeasure =&lt;BR /&gt;COUNTROWS ( FILTER ( Table1, NOT ( Table1[Pool] IN VALUES ( Table2[Pool] ) ) ) )&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 17:58:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3184725#M115256</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-12T17:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically filter the whole fact table based upon user selection in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3184821#M115264</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your answer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately it didn't quite solve the issue. Not sure what's the problem, but for some reason, I am not able to place this measure as visual level filter on my&amp;nbsp;&lt;STRONG&gt;Card Visuals&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I place it, it doesn't allow me to apply the filter on Card,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It did work on the Table Visual but I needed to show all the records if nothing is selected in the Slicer. So, I added an&amp;nbsp;&lt;STRONG&gt;IsFiltered&amp;nbsp;&lt;/STRONG&gt;condition at the top of measure, but after adding that, my filter did not work for some reason &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; Not sure where I went wrong.&amp;nbsp;&lt;BR /&gt;I used the following Measure,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Filter Measure = 
IF(
    ISFILTERED('Location Pool Mapping'[Employee Location]),
    COUNTROWS(FILTER(Employees, NOT(Employees[Pool] in VALUES('Location Pool Mapping'[Pool])))), 
    1
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 12 Apr 2023 19:01:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3184821#M115264</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-12T19:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically filter the whole fact table based upon user selection in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3184854#M115265</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No it doesn't work with card visuals. Each measure needs to include the filter code within its DAX. Fr simplicity CALCULATE - FILTER arrangement will do.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 19:37:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3184854#M115265</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-12T19:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically filter the whole fact table based upon user selection in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3184884#M115269</link>
      <description>&lt;P&gt;How can I include the filter code within the each measure DAX? Can you please help out in this?&amp;nbsp;&lt;BR /&gt;I tried to do it but it didn't work for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried something like this (only considering &lt;STRONG&gt;Billed Hours Sum Measure&amp;nbsp;&lt;/STRONG&gt;for now),&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Billed Hours = 

var _FilteredTable = 
    FILTER(
        Employees, 
        NOT(Employees[Pool] in VALUES('Location Pool Mapping'[Pool]))
    )

var _filteredSUM = 
    SUMX(
            _FilteredTable, 
            Employees[Billed Hours]
        )
var _NonFilteredSUM = SUM(Employees[Billed Hours])

var _BilledHours = 
    IF(
        ISFILTERED(Employees[Employee Location]), 
        _filteredSUM, 
        _NonFilteredSUM
    )

return _BilledHours&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result it gave me was this&amp;nbsp;&lt;STRONG&gt;(Please check Total Billed Hours)&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem with the result is it has now&amp;nbsp;&lt;STRONG&gt;excluded all&amp;nbsp;&lt;/STRONG&gt;&lt;STRONG&gt;the pools&amp;nbsp;&lt;/STRONG&gt;in my other table, rather than&amp;nbsp;&lt;STRONG&gt;only excluding the pools which were against USA.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;That is, only &lt;EM&gt;US State &lt;/EM&gt;and&amp;nbsp;&lt;EM&gt;US Bench&amp;nbsp;&lt;/EM&gt;were supposed to be excluded from the result, but it is also excluding&amp;nbsp;&lt;EM&gt;CA Bench&amp;nbsp;&lt;/EM&gt;and&amp;nbsp;&lt;EM&gt;UK Bench&amp;nbsp;&lt;/EM&gt;whicch are against the "Canada" and "UK" Locations, respectively&lt;BR /&gt;I&lt;STRONG&gt; tried to apply a Filter within the VALUES Command, but again it did not work for me.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Not sure how can I do it with CALCULATE Function, I haven't tried it and I usually try to avoid it as it most often causes more problems than I should be getting. More of a follower of&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp; on this, lol. Haven't really used CALCULATE for quite a while, and that's why I am hesitant to use it now for this as well &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 20:15:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3184884#M115269</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-12T20:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically filter the whole fact table based upon user selection in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3187159#M115436</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 20:05:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3187159#M115436</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2023-04-13T20:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically filter the whole fact table based upon user selection in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3187229#M115442</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="250150" data-lia-user-login="CNENFRNL" class="lia-mention lia-mention-user"&gt;CNENFRNL&lt;/a&gt;&amp;nbsp;&amp;nbsp;Thank you! This works so perfectly well! I just got two questions if you can answer,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, I was able to achieve somewhat of same result but with a slightly different DAX,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Billed Hours = 

VAR selected_locations = VALUES(Employees[Employee Location])

VAR Filtered_Locations_Table = 
    FILTER(
        'Location Pool Mapping', 
        'Location Pool Mapping'[Employee Location] in selected_locations
    )

var _FilteredTable = 
    FILTER(
        Employees, 
        IF(
            ISFILTERED(Employees[Employee Location]), 
            NOT(
                Employees[Pool] in 
                SUMMARIZE(Filtered_Locations_Table, [Pool])
            ),
            TRUE()
        )
    )

var _FilteredBilledHrs = 
    SUMX(
        _FilteredTable, 
        Employees[Billed Hours]
    )


var _NonFilteredBilledHrs = SUM(Employees[Billed Hours])

var _Result = 
    IF(
        ISFILTERED(Employees[Employee Location]), 
        _FilteredBilledHrs, 
        _NonFilteredBilledHrs
    )

return _Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe that using&amp;nbsp;&lt;STRONG&gt;TREATAS&amp;nbsp;&lt;/STRONG&gt;is more optimized than my approach, can you tell me if I am right to believe that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The main question, however, that now I have three measures. My problem is I need to copy paste this FILTERING CODE in each measure and then use this Filtered Table for my calculations,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;VAR selected_locations = VALUES(Employees[Employee Location])

VAR Filtered_Locations_Table = 
    FILTER(
        'Location Pool Mapping', 
        'Location Pool Mapping'[Employee Location] in selected_locations
    )

var _FilteredTable = 
    FILTER(
        Employees, 
        IF(
            ISFILTERED(Employees[Employee Location]), 
            NOT(
                Employees[Pool] in 
                SUMMARIZE(Filtered_Locations_Table, [Pool])
            ),
            TRUE()
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is very repetitive and bad practice. That is, if I want to change one thing, I will have to change in all the measures and etc.&lt;/P&gt;&lt;P&gt;I also don't have the option to use Measure to return my filtered table (because measure can't return a table). Is it any possible way to make it cleaner? Like I could create one function/measure and then call that measure in all my DAX Measures? (just like I create a measure to return my filtered table and use that measure in all my DAX Codes)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 21:00:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3187229#M115442</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-13T21:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically filter the whole fact table based upon user selection in Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3187732#M115476</link>
      <description>&lt;OL&gt;
&lt;LI&gt;performance&lt;BR /&gt;&lt;A href="https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/" target="_blank"&gt;Propagating filters using TREATAS in DAX - SQLBI&lt;/A&gt;&lt;BR /&gt;Here's a detailed comparison among major ways of filtering for your reference.&lt;/LI&gt;
&lt;LI&gt;repetition&lt;BR /&gt;AFAIK, only scalar result is permitted for a measure.&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 14 Apr 2023 06:10:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-filter-the-whole-fact-table-based-upon-user/m-p/3187732#M115476</guid>
      <dc:creator>CNENFRNL</dc:creator>
      <dc:date>2023-04-14T06:10:29Z</dc:date>
    </item>
  </channel>
</rss>

