<?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: Help with dynamic measure based on Criteria (IF not working) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/885301#M7652</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="82403" data-lia-user-login="az38" class="lia-mention lia-mention-user"&gt;az38&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the reply. When I try to use SELECTEDVALUE or CALCULATE(SUM())), I get the following error:&lt;/P&gt;&lt;P&gt;Parameter is nor the correct type&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Dec 2019 15:55:49 GMT</pubDate>
    <dc:creator>sai1092</dc:creator>
    <dc:date>2019-12-27T15:55:49Z</dc:date>
    <item>
      <title>Help with dynamic measure based on Criteria (IF not working)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/884225#M7621</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to write a single measure to show Consolidated Amount Modified for any account starting with 1 and show the Average Amount for any account starting with 4 as shown below:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Measure = IF(LEFT(VALUES(Transactions[ACCOUNTNUMBER]),1)="1", [Consolidated_Amt_Modified], VALUES(Transactions[EXCH_AMT]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I get the following error for the above formula&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Consolidated Amount Modified is a measure that multiplies the SUM(Amount) * rate (from another table for the month selected):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Consolidated_Amt = SUM(Transactions[SUM(AMOUNT)])*Calculate(MAX('rate table'[CURRENT_RATE]),FILTER('rate table','rate table'[ACCTPRD]= MAX('rate table'[ACCTPRD])))&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Consolidated_Amt_Modified = var tempTable =&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;SUMMARIZE(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Transactions,&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;Transactions[ACCOUNTNUMBER],&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;"NewColumn",[Consolidated_Amt])&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;return&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;SUMX(tempTable,[NewColumn])&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AVG_AMOUNT is already calculated in the SQL.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have attached the&amp;nbsp;&lt;A title="PBI file" href="https://drive.google.com/file/d/1fmktENvMSPJuRtMYb1U_zT4pRy6Q92ic/view?usp=sharing" target="_self" rel="nofollow noopener noreferrer"&gt;Power BI file download link&lt;/A&gt;&amp;nbsp; for your reference and happy to give further context on the data model to get this resolved.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1fmktENvMSPJuRtMYb1U_zT4pRy6Q92ic/view?usp=sharing" target="_blank" rel="noopener"&gt;https://drive.google.com/file/d/1fmktENvMSPJuRtMYb1U_zT4pRy6Q92ic/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2019 01:07:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/884225#M7621</guid>
      <dc:creator>sai1092</dc:creator>
      <dc:date>2019-12-26T01:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help with dynamic measure based on Criteria (IF not working)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/884441#M7626</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="194144" data-lia-user-login="sai1092" class="lia-mention lia-mention-user"&gt;sai1092&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i couldn't check, but at first sight the issue is as you are creating the measure, you should try to pack your measures into either SELECTEDVALUE(&lt;SPAN&gt;[Consolidated_Amt_Modified]&lt;/SPAN&gt;) or CALCULATE(SUM(&lt;SPAN&gt;[Consolidated_Amt_Modified]&lt;/SPAN&gt;))&lt;/P&gt;&lt;P&gt;the same for&amp;nbsp;&lt;SPAN&gt;[EXCH_AMT]&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Measure = IF(LEFT(VALUES(Transactions[ACCOUNTNUMBER]),1)="1", SELECTEDVALUE([Consolidated_Amt_Modified]), SELECTEDVALUE(Transactions[EXCH_AMT]))&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;I&gt;&lt;FONT color="#ababab"&gt;do not hesitate to give a kudo to useful posts and mark solutions as solution&lt;/FONT&gt;&lt;/I&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2019 09:13:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/884441#M7626</guid>
      <dc:creator>az38</dc:creator>
      <dc:date>2019-12-26T09:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help with dynamic measure based on Criteria (IF not working)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/885301#M7652</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="82403" data-lia-user-login="az38" class="lia-mention lia-mention-user"&gt;az38&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the reply. When I try to use SELECTEDVALUE or CALCULATE(SUM())), I get the following error:&lt;/P&gt;&lt;P&gt;Parameter is nor the correct type&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2019 15:55:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/885301#M7652</guid>
      <dc:creator>sai1092</dc:creator>
      <dc:date>2019-12-27T15:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: Help with dynamic measure based on Criteria (IF not working)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/913243#M8774</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I solve this? I still am stuck in the issue with creating a calculated column that decides between the two amounts based on the account number. I tried using Custom Columns, but none of them work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 05:11:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/913243#M8774</guid>
      <dc:creator>sai1092</dc:creator>
      <dc:date>2020-01-28T05:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Help with dynamic measure based on Criteria (IF not working)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/913387#M8777</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="194144" data-lia-user-login="sai1092" class="lia-mention lia-mention-user"&gt;sai1092&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't use selectevalue before meausure, Use it before column only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Remove first selectedvalue and keep second selectedvalue in&amp;nbsp; your DAX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;BR /&gt;Pravin Wattamwar&lt;BR /&gt;&lt;A href="http://www.linkedin.com/in/pravin-p-wattamwar" target="_blank"&gt;www.linkedin.com/in/pravin-p-wattamwar&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If I resolve your problem Mark it as a solution and give kudos.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 08:17:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/913387#M8777</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-28T08:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with dynamic measure based on Criteria (IF not working)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/913652#M8785</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DAX formula worked but I get the following error when I put the measure in a visual. How to solve the issue when the IF statment has to choose where one calculation is being built on a temp table and the other an aggregate?&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;</description>
      <pubDate>Tue, 28 Jan 2020 13:41:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/913652#M8785</guid>
      <dc:creator>sai1092</dc:creator>
      <dc:date>2020-01-28T13:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with dynamic measure based on Criteria (IF not working)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/913689#M8786</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Measure = IF(LEFT(Transactions[ACCOUNTNUMBER],1)="1", [Consolidated_Amt_Modified], SELECTEDVALUE(Transactions[EXCH_AMT]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume&amp;nbsp;[Consolidated_Amt_Modified] is measure and&amp;nbsp;Transactions[EXCH_AMT] is column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;BR /&gt;Pravin Wattamwar&lt;BR /&gt;&lt;A href="http://www.linkedin.com/in/pravin-p-wattamwar" target="_blank"&gt;www.linkedin.com/in/pravin-p-wattamwar&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;If I resolve your problem Mark it as a solution and give kudos.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jan 2020 14:12:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-dynamic-measure-based-on-Criteria-IF-not-working/m-p/913689#M8786</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-28T14:12:51Z</dc:date>
    </item>
  </channel>
</rss>

