<?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: IF statement measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-measure/m-p/2492825#M68695</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313840" data-lia-user-login="ruesaint_denis" class="lia-mention lia-mention-user"&gt;ruesaint_denis&lt;/a&gt;&amp;nbsp;can you share a sample data in copy paste here and the desired result and logic (in words) for that result (the visual).&lt;/P&gt;</description>
    <pubDate>Wed, 04 May 2022 08:41:05 GMT</pubDate>
    <dc:creator>SpartaBI</dc:creator>
    <dc:date>2022-05-04T08:41:05Z</dc:date>
    <item>
      <title>IF statement measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-measure/m-p/2491326#M68594</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to get this to work, I would like to get a measure what takes the Average PPS from my table, depending on certain conditions.&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;These are the columns I'd like to work with. I'd like to write a meaure that takes this logic:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If ['Is Active']=True, take value of Average PPS,&amp;nbsp;&lt;/P&gt;&lt;P&gt;else if ['Company Status']=Open &amp;amp;&amp;amp; Average PPS isnotblank, take the Average PPS when MAX['Updated At'],&amp;nbsp;&lt;/P&gt;&lt;P&gt;else "Please Check"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create a matrix that has the Company ID as the rows, and this measure is one of the columns.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Company ID does repeat, there shouldn't be more than 1 row for a company ID when ['Is Active']=True though.&lt;BR /&gt;I'm essentially trying to filter/manipulate which row to take for the Company ID's Average PPS. I don't really need to "calculate' anything, more than just filter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the help!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 15:50:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-measure/m-p/2491326#M68594</guid>
      <dc:creator>ruesaint_denis</dc:creator>
      <dc:date>2022-05-03T15:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-measure/m-p/2492825#M68695</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313840" data-lia-user-login="ruesaint_denis" class="lia-mention lia-mention-user"&gt;ruesaint_denis&lt;/a&gt;&amp;nbsp;can you share a sample data in copy paste here and the desired result and logic (in words) for that result (the visual).&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 08:41:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-measure/m-p/2492825#M68695</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-05-04T08:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-measure/m-p/2498057#M68982</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313840" data-lia-user-login="ruesaint_denis" class="lia-mention lia-mention-user"&gt;ruesaint_denis&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I create a sample with data from your screenshot to have a test.&lt;/P&gt;
&lt;P&gt;Measure:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _TRUE_AVG = CALCULATE(SUM('Table'[Average PPS]),'Table'[Is Active] = TRUE())
VAR _Active_list = CALCULATETABLE(VALUES('Table'[Is Active]),ALLEXCEPT('Table','Table'[Company Id]))
VAR _Status_list = CALCULATETABLE(VALUES('Table'[Company Status]),ALLEXCEPT('Table','Table'[Company Id]))
VAR _MAXDATE = CALCULATE(MAX('Table'[Updated At]),FILTER(ALLEXCEPT('Table','Table'[Company Id]),'Table'[Company Status] = "Open"))
VAR _OPEN_AVG = CALCULATE(SUM('Table'[Average PPS]),FILTER( ALLEXCEPT('Table','Table'[Company Id]), 'Table'[Updated At] = _MAXDATE))
RETURN
IF(TRUE() in _Active_list,_TRUE_AVG, IF("Open" in _Status_list &amp;amp;&amp;amp; _OPEN_AVG&amp;lt;&amp;gt;BLANK(),_OPEN_AVG,"Please Check"))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 08:29:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-measure/m-p/2498057#M68982</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-06T08:29:56Z</dc:date>
    </item>
  </channel>
</rss>

