<?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: Filtering table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-table/m-p/2013675#M44769</link>
    <description>&lt;P&gt;You're welcome!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
    <pubDate>Thu, 12 Aug 2021 17:24:42 GMT</pubDate>
    <dc:creator>Jos_Woolley</dc:creator>
    <dc:date>2021-08-12T17:24:42Z</dc:date>
    <item>
      <title>Filtering table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-table/m-p/2010087#M44666</link>
      <description>&lt;P&gt;As a beginner in DAX I have this report that can be filtered on a specific year and some other filters. But I want to calculate a measure that is a snapshot, not depending on a specific year or other shown filters. I tried using 'ALL' and 'Calculate', but don't get the right answer. So I need some help &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use a fact-table 'Paymentschemtable' (with a column PaymentID, SchemStatus and Contract-ID), which is filtered by another table 'Contracts' (with colums Contract ID and ContractStatus). I need to calculate the total PaymentID's, where SchemStatus=0 and ContractStatus &amp;lt;&amp;gt;"Ended". I made this measure, but the result is always the totalrows PAYMENTSCHEM where SCHEMSTATUS=0:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Measure = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;COUNTROWS(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;FILTER(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;ALL(PAYMSCHEMETABLE),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-90px"&gt;&lt;SPAN&gt;PAYMSCHEMETABLE[SCHEMSTATUS]=0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;CONTRACTS[ContractStatus]&amp;lt;&amp;gt;"Ended"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 11 Aug 2021 09:21:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-table/m-p/2010087#M44666</guid>
      <dc:creator>PZU_DGW</dc:creator>
      <dc:date>2021-08-11T09:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-table/m-p/2010348#M44671</link>
      <description>&lt;LI-CODE lang="csharp"&gt;// First of all, please don't torture
// the end user with names of tables
// written the way they are. Make them
// pleasant to the eye. Respect your
// users and future developers.

// Second, you should never slice and
// dice in the UI by columns in a fact
// table. It's dangerous and you're risking
// that your measures will one day stop
// working correctly, of which you will not
// even be aware of.

[Measure] =
CALCULATE(
    COUNTROWS( PaymentScheme ),
    // You can remove KEEPFILTERS if the column
    // it wraps will not be used in the UI to
    // slice and dice by.
    KEEPFILTERS(
    	PaymentScheme[SchemeStatus] = 0
    ),
    // Same remark applies to this one. If
    // you have a field that you're planning
    // on using in the UI, please make sure
    // it's written decently, with spaces between
    // the constituent words. Respect your
    // audience.
    KEEPFILTERS(
    	CONTRACTS[ContractStatus] &amp;lt;&amp;gt; "Ended"
    )
)

// Please learn about KEEPFILTERS to know when
// to use it. You might need to remove this
// modifier here to obtain what you want. I can't
// from your description know whether or not
// it's required. It's your task to figure this
// one out.&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 11 Aug 2021 11:31:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-table/m-p/2010348#M44671</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-11T11:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-table/m-p/2010372#M44673</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;MeasureALL =
CALCULATE (
    COUNTROWS ( PAYMSCHEMETABLE ),
    ALL ( PAYMSCHEMETABLE ),
    PAYMSCHEMETABLE[SCHEMSTATUS] = 0,
    CONTRACTS[ContractStatus] &amp;lt;&amp;gt; "Ended"
)&lt;/LI-CODE&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 11:38:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-table/m-p/2010372#M44673</guid>
      <dc:creator>Jos_Woolley</dc:creator>
      <dc:date>2021-08-11T11:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-table/m-p/2013329#M44758</link>
      <description>&lt;P&gt;Thanks Jos!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's the solution I was looking for! I forgot to add the '&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALL(PAYMSCHEMETABLE),'. It did the trick.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Greetings PZU&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Aug 2021 14:47:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-table/m-p/2013329#M44758</guid>
      <dc:creator>PZU_DGW</dc:creator>
      <dc:date>2021-08-12T14:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-table/m-p/2013675#M44769</link>
      <description>&lt;P&gt;You're welcome!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 17:24:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filtering-table/m-p/2013675#M44769</guid>
      <dc:creator>Jos_Woolley</dc:creator>
      <dc:date>2021-08-12T17:24:42Z</dc:date>
    </item>
  </channel>
</rss>

