<?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: New Dax to calculate sum by changing join in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4357519#M172986</link>
    <description>&lt;P&gt;Thanks for your time &amp;amp; dax formula, but this is giving same amt as original amt which is not as expected.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Product Product_Ref Amt Test_DAX&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;capacity&lt;/TD&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;carry value adj&lt;/TD&gt;&lt;TD&gt;capacity&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;Blank&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;carry value adj&lt;/TD&gt;&lt;TD&gt;colletral swaps&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;Blank&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;netting&lt;/TD&gt;&lt;TD&gt;capacity&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;colletral swaps&lt;/TD&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Thu, 09 Jan 2025 17:21:34 GMT</pubDate>
    <dc:creator>jagadeesh3001</dc:creator>
    <dc:date>2025-01-09T17:21:34Z</dc:date>
    <item>
      <title>New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4353881#M172867</link>
      <description>&lt;P class=""&gt;Hi All,&lt;/P&gt;&lt;P class=""&gt;I’m new to Dax, please help me get below achieved&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;fact (sample data)&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;product_id, product_ref, amt&lt;/P&gt;&lt;P class=""&gt;1,n/a,10&lt;/P&gt;&lt;P class=""&gt;2,n/a,20&lt;/P&gt;&lt;P class=""&gt;3,capacity,30&lt;/P&gt;&lt;P class=""&gt;3,colletral swaps,40&lt;BR /&gt;4,capacity,60&lt;/P&gt;&lt;P class=""&gt;6,n/a,50&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Dim product (sample data)&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;product_id, product&lt;/P&gt;&lt;P class=""&gt;1,capacity&lt;/P&gt;&lt;P class=""&gt;2,n/a&lt;/P&gt;&lt;P class=""&gt;3,carry value adj&lt;/P&gt;&lt;P class=""&gt;4,netting&lt;/P&gt;&lt;P class=""&gt;5,tba sales&lt;/P&gt;&lt;P class=""&gt;6,colletral swaps&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Dim product ref (sampel data)&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;product_ref&lt;/P&gt;&lt;P class=""&gt;N/a&lt;/P&gt;&lt;P class=""&gt;capacity&lt;/P&gt;&lt;P class=""&gt;colletral swaps&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Using abv 3 tables&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Pbi model&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Fact (product_id) joined to dim product (product_id)&lt;/P&gt;&lt;P class=""&gt;Fact (product_ref) joined to dim_product_ref (product_ref)&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;With these joins if I create a simple report with amt&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Product, product_ref, amt&lt;/P&gt;&lt;P class=""&gt;capacity,n/a,10&lt;/P&gt;&lt;P class=""&gt;n/a,n/a,20&lt;/P&gt;&lt;P class=""&gt;carry value adj,capacity,30&lt;/P&gt;&lt;P class=""&gt;carry value adj,colletral swaps,40&lt;BR /&gt;netting,capacity,60&lt;/P&gt;&lt;P class=""&gt;colletral swaps,n/a,50&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Now I need a new Dax measure (test_dax) to get below out put&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Product, product_ref, amt, test_dax&lt;/P&gt;&lt;P class=""&gt;capacity,n/a,10,30&lt;/P&gt;&lt;P class=""&gt;n/a,n/a,20,blank&lt;/P&gt;&lt;P class=""&gt;carry value adj,capacity,30,blank&lt;/P&gt;&lt;P class=""&gt;carry value adj,colletral swaps,40,blank&lt;BR /&gt;netting,capacity,60,blank&lt;/P&gt;&lt;P class=""&gt;colletral swaps,n/a,50,40&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;As you see new Dax measure is calculated based off of summarized/sub set of (prod_ref, amt - by applying filter on prod = carry value adj) then left join&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;prod_ref with product to get amt&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I have tried using treatas but didn’t get me desired output&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 18:04:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4353881#M172867</guid>
      <dc:creator>jagadeesh3001</dc:creator>
      <dc:date>2025-01-07T18:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4354036#M172873</link>
      <description>&lt;LI-CODE lang="markup"&gt;As you see new Dax measure is calculated based off of summarized/sub set of (prod_ref, amt - by applying filter on prod = carry value adj) then left join  prod_ref with product to get amt&lt;/LI-CODE&gt;
&lt;P&gt;I don't see that.&amp;nbsp; Please walk me through an example for product 1 and another example for product 4.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 21:33:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4354036#M172873</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-01-07T21:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4354076#M172877</link>
      <description>&lt;P&gt;This is current report based on all joins explained (Fact to Product based on Product_iD; to Product_ref based on product_ref)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Product Product_Ref Amt&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;capacity&lt;/TD&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;carry value adj&lt;/TD&gt;&lt;TD&gt;capacity&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;carry value adj&lt;/TD&gt;&lt;TD&gt;colletral swaps&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;netting&lt;/TD&gt;&lt;TD&gt;capacity&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;colletral swaps&lt;/TD&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Need test_dax as shown below&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Product Product_Ref Amt Test_DAX&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;capacity&lt;/TD&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;30&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;Blank&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;carry value adj&lt;/TD&gt;&lt;TD&gt;capacity&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;Blank&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;carry value adj&lt;/TD&gt;&lt;TD&gt;colletral swaps&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;Blank&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;netting&lt;/TD&gt;&lt;TD&gt;capacity&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;Blank&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;colletral swaps&lt;/TD&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;40&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 22:38:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4354076#M172877</guid>
      <dc:creator>jagadeesh3001</dc:creator>
      <dc:date>2025-01-07T22:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4354093#M172879</link>
      <description>&lt;P&gt;here is current report based on joins explained abv&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;i need below&amp;nbsp;"test_dax"&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if i filter original data for Product = "carry value adj"&lt;BR /&gt;subset of product_ref, amt looks like below (which is what looked up to populate in new test_dax)&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i would like to know how this can be done in DAX&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 22:48:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4354093#M172879</guid>
      <dc:creator>jagadeesh3001</dc:creator>
      <dc:date>2025-01-07T22:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4354946#M172898</link>
      <description>&lt;P&gt;Yes TREATAS isnt working.Even I tried it and I am completly stumped as to why it isnt working.Either its a bug or I am doing something totally silly. I hope its not the latter.&lt;BR /&gt;&lt;BR /&gt;The sample PBIX file is attached &lt;A href="https://drive.google.com/file/d/1HPstCtZzi_5926MV2ue1ry_TRLAt8RCg/view?usp=sharing" target="_self"&gt;here&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;There are 2 measures in the attached report that use TREATAS, one referencing the Filtered Table and other referencing the Table variable in the measure and both arent working.&lt;BR /&gt;&lt;BR /&gt;Hope the DAX gurus in thes forum can help solve the mystery&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 08:38:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4354946#M172898</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2025-01-09T08:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4354961#M172899</link>
      <description>&lt;P&gt;Both of your measures are attempting to return a table, but measures can only return scalar values, not tables.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 10:43:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4354961#M172899</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-01-08T10:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4354983#M172900</link>
      <description>&lt;P&gt;Yes.I somehow missed that.But the measure should had thrown an error and it didnt.&lt;BR /&gt;&lt;BR /&gt;I changed the measure to return a scalar value and still no output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Test_DAX_Filtered_table = VAR Filtered_carry_value_adj_Table =
    FILTER(
        'Dim product',
        'Dim product'[Product] = "carry value adj"
    )

VAR FilteredProductRefs =
    SELECTCOLUMNS(
        'Filtered_carry_value_adj_Table',
        "Product_Ref", 'Filtered_carry_value_adj_Table'[Product]
    )
   
VAR RelatedFact =
    CALCULATETABLE(
        'fact',
        TREATAS(FilteredProductRefs, 'fact'[Product Ref])
    )
RETURN
    SUMX(RelatedFact, 'fact'[Amount])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Edit: I have fixed the measures and uploaded a new file &lt;A href="https://drive.google.com/file/d/15L9n6mi_lBM4D8J1zmooNhRYnsTxntQb/view?usp=sharing" target="_self"&gt;here&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 15:09:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4354983#M172900</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2025-01-08T15:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4355106#M172907</link>
      <description>&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;"carry value adj" doesn't exist in the 'fact'[product ref] column, so there is nothing to return.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Jan 2025 12:02:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4355106#M172907</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-01-08T12:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4355246#M172910</link>
      <description>&lt;P&gt;My understanding of the flow is ,&lt;BR /&gt;&lt;BR /&gt;Filter Dim Product table on "carry value adj" and return product id which is 3 and then use this id to return Product ref column values&amp;nbsp;"capacity" and "collateral swaps" from fact table.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In the next step, get a match for "capacity" and "collateral swaps" across the tables Dim product and Fact(this is where TREATAS comes into picture) and then display the Amount across each Product from the Dim Product table.&lt;BR /&gt;&lt;BR /&gt;Since we only have&amp;nbsp;"capacity" and "collateral swaps", take the matching amount 30 and 40 respectively and display it against the&amp;nbsp;"capacity" and "collateral swaps" values of the Product columns in the Dim Product table.&lt;BR /&gt;&lt;BR /&gt;the final output should be something like this&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;In this flow the Product_Ref lookup table is completly ignored.It still doesnt explain why TREATAS isnt working.&lt;BR /&gt;&lt;BR /&gt;I deleted the table&amp;nbsp;Product Ref from model and it made no difference and then readded the table &lt;SPAN&gt;Product Ref&lt;/SPAN&gt; and added the value "carry value adj" to it and still no output.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 15:16:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4355246#M172910</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2025-01-08T15:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4355306#M172916</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="909435" data-lia-user-login="jagadeesh3001" class="lia-mention lia-mention-user"&gt;jagadeesh3001&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To create the test_dax measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Condition: If the product is "carry value adj", return BLANK().&lt;/P&gt;&lt;P&gt;Otherwise, calculate the sum of amt by filtering product_ref and matching it with the product_ref in the fact table.&lt;/P&gt;&lt;P&gt;TREATAS: Applies the filter on product to get the correct amt based on the condition.&lt;/P&gt;&lt;P&gt;Use the following DAX formula for test_dax:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;test_dax = 
IF(
    SELECTEDVALUE(DimProduct[product]) = "carry value adj",
    BLANK(),
    CALCULATE(
        SUM(Fact[amt]),
        FILTER(
            DimProductRef,
            DimProductRef[product_ref] = SELECTEDVALUE(Fact[product_ref])
        ),
        TREATAS(
            VALUES(DimProduct[product]),
            DimProduct[product]
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will give you the desired output, showing amt based on the filtered conditions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution, this will help others!&lt;/STRONG&gt;&lt;BR /&gt;If my response(s) assisted you in any way, don't forget to drop me a "&lt;STRONG&gt;Kudos&lt;/STRONG&gt;" &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;BR /&gt;Poojara&lt;BR /&gt;Data Analyst | MSBI Developer | Power BI Consultant&lt;BR /&gt;&lt;STRONG&gt;Consider Subscribing my YouTube for Beginners/Advance Concepts&lt;/STRONG&gt;:&amp;nbsp;&lt;A href="https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS" target="_self"&gt;https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 13:30:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4355306#M172916</guid>
      <dc:creator>Poojara_D12</dc:creator>
      <dc:date>2025-01-08T13:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4356477#M172955</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="777262" data-lia-user-login="SachinNandanwar" class="lia-mention lia-mention-user"&gt;SachinNandanwar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please allow me to share some methods here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you create a table with the correct relationship to "Dim product" like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;SummaryTable = 
VAR FilteredProductID = 
CALCULATETABLE(
    VALUES('Dim product'[Product ID]),
    'Dim product'[product] = "carry value adj"
)
VAR FilteredFactTable = 
CALCULATETABLE(
    'fact',
    'fact'[Product ID] IN FilteredProductID
    )
RETURN
SUMMARIZE(
        FilteredFactTable,
        'fact'[Product Ref],
        "SumAmt", SUM('fact'[Amount])
)&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;Additionally, to ensure that the visual displays as you intended, I also modified the relationship between "Dim product" and "fact" as follows:&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;Here is the result.&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;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, 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, 09 Jan 2025 06:46:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4356477#M172955</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-09T06:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4356755#M172962</link>
      <description>&lt;P&gt;Thats great&amp;nbsp;Anonymous&lt;/a&gt;.&lt;BR /&gt;&lt;BR /&gt;Why TREATAS doesnt work in this case remains a mystery.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 08:41:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4356755#M172962</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2025-01-09T08:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4356886#M172966</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="777262" data-lia-user-login="SachinNandanwar" class="lia-mention lia-mention-user"&gt;SachinNandanwar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me try to explain the use of TREATAS to you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First analyze your code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR Filtered_carry_value_adj_Table =
    FILTER(
        'Dim product',
        'Dim product'[Product] = "carry value adj"
    )
VAR FilteredProductRefs =
    SELECTCOLUMNS(
        'Table_Carry_Value_Adj',
        "Product_Ref", 'Table_Carry_Value_Adj'[Product]
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first step is to look for the value “Product” as “carry value adj” in the Dim table and create a table. Here you can run it alone and you will get the following result:&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;Note that the documentation describes the "If a value returned in the table expression does not exist in the column, it is ignored."&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;According to the table data you provided, there is no corresponding “carry value adj” data in the “Fact” table, so you will not get any results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR RelatedFact =
    CALCULATETABLE(
        'fact',
        TREATAS(FilteredProductRefs, 'fact'[Product Ref])
    )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have made the following changes to your code: Since “product id” is corresponding, consider using the id column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Test_TREATAS = 
VAR FilteredProductRefs = 
    SELECTCOLUMNS(
        FILTER(
            'Dim Product',
            'Dim Product'[product] = "carry value adj"
        ),
        "Product id", 'Dim product'[Product ID]
    )
VAR RelatedFact = 
    CALCULATETABLE(
        'fact',
        TREATAS(FilteredProductRefs, 'fact'[Product ID])
    )
RETURN
    SUMX(RelatedFact, 'fact'[Amount])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, please note that this way the data corresponds to the product id, which means that you can't use this function to get the expected result. Therefore, I recommend that you abandon the use of this function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;actual result&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Expected results&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope I've explained this clearly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/TREATAS-function-dax" target="_blank"&gt;TREATAS function - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Nono Chen&lt;/P&gt;
&lt;P&gt;If this &lt;STRONG&gt;&lt;EM&gt;post&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;helps, 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, 09 Jan 2025 09:41:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4356886#M172966</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-09T09:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4356982#M172971</link>
      <description>&lt;P&gt;Thank you Anonymous&lt;/a&gt;&amp;nbsp;for the detailed explaination.It now makes more sense. Appreciate it.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 10:40:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4356982#M172971</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2025-01-09T10:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4357516#M172985</link>
      <description>&lt;P&gt;Thanks for your time &amp;amp; explanation.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 16:18:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4357516#M172985</guid>
      <dc:creator>jagadeesh3001</dc:creator>
      <dc:date>2025-01-09T16:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4357519#M172986</link>
      <description>&lt;P&gt;Thanks for your time &amp;amp; dax formula, but this is giving same amt as original amt which is not as expected.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Product Product_Ref Amt Test_DAX&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;capacity&lt;/TD&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;carry value adj&lt;/TD&gt;&lt;TD&gt;capacity&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;Blank&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;carry value adj&lt;/TD&gt;&lt;TD&gt;colletral swaps&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;Blank&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;netting&lt;/TD&gt;&lt;TD&gt;capacity&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;TD&gt;60&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;colletral swaps&lt;/TD&gt;&lt;TD&gt;n/a&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 09 Jan 2025 17:21:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4357519#M172986</guid>
      <dc:creator>jagadeesh3001</dc:creator>
      <dc:date>2025-01-09T17:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: New Dax to calculate sum by changing join</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4361847#M173173</link>
      <description>&lt;P&gt;Here one more solution i found after multiple tries&lt;BR /&gt;&lt;BR /&gt;this don't need any changes in data model/joins (also not needed to use treatas / userelationship)&lt;BR /&gt;&lt;BR /&gt;test_dax = IF (SELECTEDVALUE('Dim Product'[Product]) = "carry value adj",&lt;BR /&gt;BLANK(),&lt;BR /&gt;CALCULATE( SUM('fact'[amt]),&lt;BR /&gt;'dim product ref'[product ref]=SELECTEDVALUE('dim product'[product]),&lt;BR /&gt;ALL('dim product'[product])&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 15:41:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Dax-to-calculate-sum-by-changing-join/m-p/4361847#M173173</guid>
      <dc:creator>jagadeesh3001</dc:creator>
      <dc:date>2025-01-13T15:41:43Z</dc:date>
    </item>
  </channel>
</rss>

