<?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: Calculate amount based on substring, show value on matching row (in a measure) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524318#M70534</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374854" data-lia-user-login="Broderskap777" class="lia-mention lia-mention-user"&gt;Broderskap777&lt;/a&gt;&amp;nbsp;my pleasure &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 18 May 2022 19:59:59 GMT</pubDate>
    <dc:creator>SpartaBI</dc:creator>
    <dc:date>2022-05-18T19:59:59Z</dc:date>
    <item>
      <title>Calculate amount based on substring, show value on matching row (in a measure)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524092#M70513</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am trying to figure out if there is any way to get the row values from one "Transaction Number" to a another "Transaction Number" in the same column.&lt;/P&gt;&lt;P&gt;For example, I have a transaction number that have som form of amount. Sometimes, there are transactions that have the identical number but start with a "C". The C stands for "Correction" and I would like to get the values from the ones that start with "C" and show the results in a measure but on the row with the corresponding number without a letter. Is this possible to do as measure?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 17:52:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524092#M70513</guid>
      <dc:creator>Broderskap777</dc:creator>
      <dc:date>2022-05-18T17:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate amount based on substring, show value on matching row (in a measure)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524136#M70516</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374854" data-lia-user-login="Broderskap777" class="lia-mention lia-mention-user"&gt;Broderskap777&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;NewMeasure =
SUMX (
    VALUES ( TableName[Transactio Number] ),
    CALCULATE (
        IF (
            RIGHT ( SELECTEDVALUE ( TableName[Transactio Number] ), 1 ) &amp;lt;&amp;gt; "C",
            CALCULATE (
                [Amount],
                FILTER (
                    ALL ( TableName ),
                    TableName[Transactio Number]
                        = "C" &amp;amp; SELECTEDVALUE ( TableName[Transactio Number] )
                )
            )
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 18:33:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524136#M70516</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-18T18:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate amount based on substring, show value on matching row (in a measure)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524164#M70519</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374854" data-lia-user-login="Broderskap777" class="lia-mention lia-mention-user"&gt;Broderskap777&lt;/a&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;New Measure = 
SUMX(
    VALUES('Table'[Transaction Number]),
    VAR _current_tr_num = 'Table'[Transaction Number]
    VAR _correction = "C" &amp;amp; _current_tr_num
    VAR _result = CALCULATE([Amount Measure],'Table'[Transaction Number] = _correction) 
    RETURN
        _result
)&lt;/LI-CODE&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;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Data-Stories-Gallery/Contoso-by-SpartaBI/m-p/2449543" target="_blank" rel="noopener"&gt;Showcase Report – Contoso By SpartaBI&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;A href="https://www.linkedin.com/company/spartabi" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt; &amp;nbsp;&amp;nbsp;&lt;A href="https://www.facebook.com/SpartaBI" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://www.spartabi.com" target="_blank" rel="noopener"&gt;&lt;img /&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 18:35:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524164#M70519</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-05-18T18:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate amount based on substring, show value on matching row (in a measure)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524273#M70528</link>
      <description>&lt;P&gt;Thank you both for the quick replies. Unfortunately, I can’t get any of the codes to work since I misread my own data. The numbers are not identical, but the first 0 is replaced with a "C" e.g.&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;For your code&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/377293" target="_blank"&gt;@SpartaBI&lt;/A&gt;&amp;nbsp;, I tried to alter the code like this (for the second variable):&amp;nbsp;&lt;/P&gt;&lt;P&gt;"C" &amp;amp; LEFT(_current_tr_num,LEN(_current_tr_num)-1) .. But I might be getting the logic wrong.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;And for your code&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/317289" target="_blank"&gt;@tamerj1&lt;/A&gt;&amp;nbsp;&amp;nbsp;I couldn’t get "selectedvalue" to work (it was greyed out and not found by intellicense) so I replaced it with "hasonevalue", but the code is returning blanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I apologize in advance if the solution is simple. but I am a beginner in DAX.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 19:41:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524273#M70528</guid>
      <dc:creator>Broderskap777</dc:creator>
      <dc:date>2022-05-18T19:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate amount based on substring, show value on matching row (in a measure)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524278#M70530</link>
      <description>&lt;P&gt;Thank you both for the quick replies. Unfortunately, I can’t get any of the codes to work since I misread my own data. The numbers are not identical, but the first 0 is replaced with a "C" e.g.&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;For your code&amp;nbsp;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/377293" target="_blank"&gt;@SpartaBI&lt;/A&gt;&amp;nbsp;, I tried to alter the code like this (for the second variable):&amp;nbsp;&lt;/P&gt;&lt;P&gt;"C" &amp;amp; LEFT(_current_tr_num,LEN(_current_tr_num)-1) .. But I might be getting the logic wrong.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;And for your code&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/317289" target="_blank"&gt;@tamerj1&lt;/A&gt;&amp;nbsp;&amp;nbsp;I couldn’t get "selectedvalue" to work (it was greyed out and not found by intellicense) so I replaced it with "hasonevalue", but the code is returning blanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I apologize in advance if the solution is simple. but I am a beginner in DAX.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 19:43:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524278#M70530</guid>
      <dc:creator>Broderskap777</dc:creator>
      <dc:date>2022-05-18T19:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate amount based on substring, show value on matching row (in a measure)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524306#M70532</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374854" data-lia-user-login="Broderskap777" class="lia-mention lia-mention-user"&gt;Broderskap777&lt;/a&gt;&amp;nbsp;replace the LEFT with RIGHT &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 19:57:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524306#M70532</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-05-18T19:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate amount based on substring, show value on matching row (in a measure)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524313#M70533</link>
      <description>&lt;P&gt;hahaha it's amazing how the brain can fail you at times :')&lt;BR /&gt;&lt;BR /&gt;thank you, worked like a charm!&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 19:59:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524313#M70533</guid>
      <dc:creator>Broderskap777</dc:creator>
      <dc:date>2022-05-18T19:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate amount based on substring, show value on matching row (in a measure)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524318#M70534</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="374854" data-lia-user-login="Broderskap777" class="lia-mention lia-mention-user"&gt;Broderskap777&lt;/a&gt;&amp;nbsp;my pleasure &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 19:59:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-amount-based-on-substring-show-value-on-matching-row/m-p/2524318#M70534</guid>
      <dc:creator>SpartaBI</dc:creator>
      <dc:date>2022-05-18T19:59:59Z</dc:date>
    </item>
  </channel>
</rss>

