<?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: Looking for diff of two values by filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2948790#M97656</link>
    <description>&lt;P&gt;Great. Giving accurate solution. very grateful .awesome works. both dax works great&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291363" data-lia-user-login="ERD" class="lia-mention lia-mention-user"&gt;ERD&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403972" data-lia-user-login="v-jianboli-msft" class="lia-mention lia-mention-user"&gt;v-jianboli-msft&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Dec 2022 15:09:36 GMT</pubDate>
    <dc:creator>sarath_chandra</dc:creator>
    <dc:date>2022-12-05T15:09:36Z</dc:date>
    <item>
      <title>Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2936399#M96819</link>
      <description>&lt;P&gt;Hi all, please help me for solution.&lt;/P&gt;&lt;P&gt;kindly see the data set . there is cycle column with Q1,Q2,Q3. with ID , Amount column&lt;/P&gt;&lt;P&gt;I need difference of two cycle (which i'm selecting in filter) higher cycle will be base in difference&lt;/P&gt;&lt;P&gt;i attached dax, power bi view images also.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dax which previously tried showing the difference(q3-q2-q1) which is working while im selecting q3 and q2 or q3 and q1.&lt;/P&gt;&lt;P&gt;but if im selecting q2 and q1 in filter . it should show q2 - q1 as answer. but this dax showing ( -q2-q1). here q2 should be base in difference.&lt;/P&gt;&lt;P&gt;please help me out ?&lt;/P&gt;&lt;P&gt;highly appreciate for solution&amp;nbsp;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 16:20:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2936399#M96819</guid>
      <dc:creator>sarath_chandra</dc:creator>
      <dc:date>2022-11-29T16:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2936414#M96821</link>
      <description>&lt;P&gt;&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;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;please help me for above query&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2022 16:30:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2936414#M96821</guid>
      <dc:creator>sarath_chandra</dc:creator>
      <dc:date>2022-11-29T16:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2937832#M96917</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="479003" data-lia-user-login="sarath_chandra" class="lia-mention lia-mention-user"&gt;sarath_chandra&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is Cycle? What is the calculation logic of Difference, and where is Q4?&lt;/P&gt;
&lt;P&gt;Sorry for that the information you have provided is not making the problem clear to me. Can you please share more details to help us clarify your scenario?&lt;/P&gt;
&lt;P&gt;Please provide me with more details about your table and your problem or share me with your pbix file after&amp;nbsp;&lt;STRONG&gt;removing sensitive data.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Refer to:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7Cv-jianboli%40microsoft.com%7Ca7ce12be0f454896a61208da8034281b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637963258750159993%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=orVyE0%2FImc2MEFUqXtCveK0uf33594f67ZDxb8ybuNI%3D&amp;amp;reserved=0" target="_blank"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7Cv-jianboli%40microsoft.com%7Ca7ce12be0f454896a61208da8034281b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637963258750159993%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=XocTq9o6TjxbxJqTak20E3kKp7q5HxKTNZef7xESMV0%3D&amp;amp;reserved=0" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 07:13:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2937832#M96917</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2022-11-30T07:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2937983#M96924</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403972" data-lia-user-login="v-jianboli-msft" class="lia-mention lia-mention-user"&gt;v-jianboli-msft&lt;/a&gt;&amp;nbsp; hi, thanks for your reply. table contains cycle , ID , amount as columns . the cycle contains q1,q2,q3,q4,q5 ... I need cycle as filter . and in matrix visual i need cycle in column ,ID in rows . for example , if i selected q4,q3 in filter, it should show the difference in matrix visual .(q4-q3) like that .. if i selecting the q3,q2 in filter , it should show difference in matrix visual (q3-q2). in cycle column is not unique column it will have multiple q1 ,q2,q3,q4....Hope you understand my query&lt;/P&gt;&lt;P&gt;thanks a lot for your reply&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 07:54:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2937983#M96924</guid>
      <dc:creator>sarath_chandra</dc:creator>
      <dc:date>2022-11-30T07:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2938779#M96969</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="460868" data-lia-user-login="FreemanZ" class="lia-mention lia-mention-user"&gt;FreemanZ&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299202" data-lia-user-login="lukiz84" class="lia-mention lia-mention-user"&gt;lukiz84&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;@Greg Deckler .hi all. please help me out from this&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 11:56:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2938779#M96969</guid>
      <dc:creator>sarath_chandra</dc:creator>
      <dc:date>2022-11-30T11:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2939015#M96989</link>
      <description>&lt;P&gt;i am not sure if i could be of any help, but could you help provide more info about your case to enable others to help you, ideally the pbix file?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 13:35:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2939015#M96989</guid>
      <dc:creator>FreemanZ</dc:creator>
      <dc:date>2022-11-30T13:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2939257#M97016</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;hope i provide the clear requirement ? plz help me out of this. im&amp;nbsp; not able to share the pbix file . is there any way to share . please help me on this too .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks a lot .plz clear my queries@FreemanZ&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 14:55:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2939257#M97016</guid>
      <dc:creator>sarath_chandra</dc:creator>
      <dc:date>2022-11-30T14:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2939469#M97029</link>
      <description>&lt;P&gt;&lt;A title="please use this link and go to the pbix file which is already uploaded in the community" href="https://community.powerbi.com/t5/Desktop/Looking-for-difference-between-two-values-by-filters/td-p/1433585" target="_self"&gt;https://community.powerbi.com/t5/Desktop/Looking-for-difference-between-two-values-by-filters/td-p/1433585&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please use this link and click the first question, you will get the pbix file&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 15:45:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2939469#M97029</guid>
      <dc:creator>sarath_chandra</dc:creator>
      <dc:date>2022-11-30T15:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2939474#M97030</link>
      <description>&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Looking-for-difference-between-two-values-by-filters/td-p/1433585" target="_self"&gt;https://community.powerbi.com/t5/Desktop/Looking-for-difference-between-two-values-by-filters/td-p/1433585&lt;/A&gt;&amp;nbsp;use this link and get the pbix file which is already uploaded in community . please help me in this&lt;/P&gt;</description>
      <pubDate>Wed, 30 Nov 2022 15:47:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2939474#M97030</guid>
      <dc:creator>sarath_chandra</dc:creator>
      <dc:date>2022-11-30T15:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2940843#M97121</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="479003" data-lia-user-login="sarath_chandra" class="lia-mention lia-mention-user"&gt;sarath_chandra&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;P&gt;First create a measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DIfference = 
VAR _a =
    SUMMARIZE (
        'Table',
        'Table'[Cycle],
        'Table'[Amount],
        "Rank", VALUE ( RIGHT ( [Cycle], LEN ( [Cycle] ) - 1 ) )
    )
VAR _b =
    MAXX ( _a, [Rank] )
VAR _c =
    SUMX ( FILTER ( _a, [Rank] = _b ), [Amount] )
VAR _d =
    SUMX ( FILTER ( _a, [Rank] &amp;lt; _b ), [Amount] )
RETURN
    _c - _d
&lt;/LI-CODE&gt;
&lt;P&gt;Then apply it to the matrix visual:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Turn off the Rowsubtotals and change the name of Columnsubtotal:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 05:25:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2940843#M97121</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2022-12-01T05:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2940987#M97135</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403972" data-lia-user-login="v-jianboli-msft" class="lia-mention lia-mention-user"&gt;v-jianboli-msft&lt;/a&gt;&amp;nbsp;Hi , Great thanks for your quick response . but you are Q3 and Q1 , ID 24 is working correctly . but ID 25 , it should show negative value (Q3 - Q2)&amp;nbsp; answer should be (0- 99.90) is -99.90. .Please help me on this . great thanks for your response . highly appreciate for your works . amazed!!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 06:31:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2940987#M97135</guid>
      <dc:creator>sarath_chandra</dc:creator>
      <dc:date>2022-12-01T06:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2941845#M97205</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="479003" data-lia-user-login="sarath_chandra" class="lia-mention lia-mention-user"&gt;sarath_chandra&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Hope this measure helps:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;result = 
VAR current_id = SELECTEDVALUE ( 'Table'[ID] )
VAR current_cycle = SELECTEDVALUE ( 'Table 2'[Cycle] )
VAR t =
    ADDCOLUMNS (
        ALLSELECTED ( 'Table'[Cycle] ),
        "@maxrank",
            CALCULATE (
                MAX ( 'Table 2'[Rank] ),
                'Table 2'[Cycle] IN ALLSELECTED ( 'Table'[Cycle] ),
                REMOVEFILTERS ()
            ),
        "@minrank",
            CALCULATE (
                MIN ( 'Table 2'[Rank] ),
                'Table 2'[Cycle] IN ALLSELECTED ( 'Table'[Cycle] ),
                REMOVEFILTERS ()
            )
    )
VAR maxRank = MAXX ( t, [@maxrank] )
VAR minRank = MINX ( t, [@minrank] )
VAR maxCycle =
    CALCULATE (
        MAX ( 'Table 2'[Cycle] ),
        'Table 2'[Rank] = maxRank,
        REMOVEFILTERS ()
    )
VAR minCycle =
    CALCULATE (
        MAX ( 'Table 2'[Cycle] ),
        'Table 2'[Rank] = minRank,
        REMOVEFILTERS ()
    )
VAR _sAmountMaxCycle =
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        'Table'[ID] = current_id,
        'Table'[Cycle] = maxCycle
    )
VAR _sAmountMinCycle =
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        'Table'[ID] = current_id,
        'Table'[Cycle] = minCycle
    )
VAR result =
    SWITCH (
        SELECTEDVALUE ( 'Table 2'[Cycle] ),
        "XDifference", _sAmountMaxCycle - _sAmountMinCycle,
        IF (
            MAX ( 'Table 2'[Cycle] ) IN ALLSELECTED ( 'Table'[Cycle] ),
            CALCULATE (
                SUM ( 'Table'[Amount] ),
                'Table'[ID] = current_id,
                'Table'[Cycle] = current_cycle
            )
        )
    )
RETURN
    result&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Please, take into account that I've added a Rank column to the Table 2:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 12:08:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2941845#M97205</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2022-12-01T12:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2943387#M97295</link>
      <description>&lt;P&gt;Thanks for your great work. HIGHLY appreciative. CAN you please share calculated column -rank column coding for me ??it will be helpful for me to validate properly .plz share it .thanks a lot for yor great work &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291363" data-lia-user-login="ERD" class="lia-mention lia-mention-user"&gt;ERD&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 03:17:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2943387#M97295</guid>
      <dc:creator>sarath_chandra</dc:creator>
      <dc:date>2022-12-02T03:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2943691#M97307</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="479003" data-lia-user-login="sarath_chandra" class="lia-mention lia-mention-user"&gt;sarath_chandra&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Approve with&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291363" data-lia-user-login="ERD" class="lia-mention lia-mention-user"&gt;ERD&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;Besides, I have modified my measure. Please try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _a =
    CALCULATE ( MAX ( 'Table'[Cycle] ), ALLEXCEPT ( 'Table', 'Table'[Cycle] ) )
VAR _b =
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        FILTER ( ALL ( 'Table' ), [ID] = MAX ( 'Table'[ID] ) &amp;amp;&amp;amp; [Cycle] = _a )
    )
VAR _c =
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        FILTER ( 'Table' , [ID] = MAX ( 'Table'[ID] ) &amp;amp;&amp;amp; [Cycle] &amp;lt; _a )
    )
RETURN _b-_c&lt;/LI-CODE&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 06:47:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2943691#M97307</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2022-12-02T06:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2943938#M97327</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="479003" data-lia-user-login="sarath_chandra" class="lia-mention lia-mention-user"&gt;sarath_chandra&lt;/a&gt;&amp;nbsp;, you can create it either in Power Query or in DAX. I just prefer to create Dim tables at Power Query level if possible. To do so in this case:&lt;/P&gt;&lt;P&gt;Create a reference to your Data table and perform needed steps:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let
    Source = Table,
    #"Removed Other Columns" = Table.SelectColumns(Source,{"Cycle"}),
    #"Removed Duplicates" = Table.Distinct(#"Removed Other Columns"),
    Custom1 = Table.InsertRows(#"Removed Duplicates", 1, {[Cycle = "XDifference"]}),
    #"Added Custom1" = Table.AddColumn(Custom1, "Custom", each [Cycle]),
    #"Split Column by Position1" = Table.SplitColumn(#"Added Custom1", "Custom", Splitter.SplitTextByPositions({0, 1}, false), {"Custom.1", "Custom.2"}),
    #"Removed Columns1" = Table.RemoveColumns(#"Split Column by Position1",{"Custom.1"}),
    #"Replaced Value" = Table.ReplaceValue(#"Removed Columns1","Difference","9999",Replacer.ReplaceText,{"Custom.2"}),
    #"Changed Type2" = Table.TransformColumnTypes(#"Replaced Value",{{"Custom.2", Int64.Type}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type2",{{"Custom.2", "Rank"}})
in
    #"Renamed Columns"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case of calculated column:&lt;/P&gt;&lt;P&gt;1. Create a column with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Column =
IF (
    RIGHT ( 'Table 2'[Cycle], LEN ( 'Table 2'[Cycle] ) - 1 ) = "Difference",
    "9999",
    RIGHT ( 'Table 2'[Cycle], LEN ( 'Table 2'[Cycle] ) - 1 )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Change column type to Whole number.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 08:15:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2943938#M97327</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2022-12-02T08:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2944025#M97338</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403972" data-lia-user-login="v-jianboli-msft" class="lia-mention lia-mention-user"&gt;v-jianboli-msft&lt;/a&gt;&amp;nbsp;, I like the shorter version, and I relied on the Q1-Q4 values at first, too. However, then I saw that sarath_chandra mentioned '&lt;SPAN&gt;&lt;EM&gt;the cycle contains q1,q2,q3,q4,q5 ...&amp;nbsp;&lt;/EM&gt;', so I guess Qn is not a quarter, it's something else.. In this case, try to add Q10 - it won't work as expected..&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;As for renaming 'Total' to something else, did't notice that, that's what I might use, thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2022 08:44:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2944025#M97338</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2022-12-02T08:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for diff of two values by filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2948790#M97656</link>
      <description>&lt;P&gt;Great. Giving accurate solution. very grateful .awesome works. both dax works great&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291363" data-lia-user-login="ERD" class="lia-mention lia-mention-user"&gt;ERD&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403972" data-lia-user-login="v-jianboli-msft" class="lia-mention lia-mention-user"&gt;v-jianboli-msft&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 15:09:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Looking-for-diff-of-two-values-by-filters/m-p/2948790#M97656</guid>
      <dc:creator>sarath_chandra</dc:creator>
      <dc:date>2022-12-05T15:09:36Z</dc:date>
    </item>
  </channel>
</rss>

