<?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: Variations affecting all rows in table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variations-affecting-all-rows-in-table/m-p/2573647#M73622</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398761" data-lia-user-login="MarkEden" class="lia-mention lia-mention-user"&gt;MarkEden&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, in my understanding, you want for example for Insurer B, only when the Risk Class row is Marine, it should be "[Total Premium] + [Insurer C Marine Premium]", otherwise, it should be&amp;nbsp;"[Total Premium]".&lt;/P&gt;
&lt;P&gt;If this is the case, here's my solution.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total including variations =
SWITCH (
    TRUE (),
    [Selected Insurer] = "Insurer A",
        [Total Premium] + [Insurer C Accident &amp;amp; Health Premium] + [Insurer C Professional Risks Premium],
    [Selected Insurer] = "Insurer B",
        IF (
            MAX ( [Risk Class] ) = "Marine",
            [Total Premium] + [Insurer C Marine Premium],
            [Total Premium]
        ),
    [Total Premium]
)
&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jun 2022 02:52:11 GMT</pubDate>
    <dc:creator>v-yanjiang-msft</dc:creator>
    <dc:date>2022-06-13T02:52:11Z</dc:date>
    <item>
      <title>Variations affecting all rows in table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variations-affecting-all-rows-in-table/m-p/2566216#M73130</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to PowerBI &amp;amp; DAX and am struggling with creating a variation on a comparison of insurance products premiums for last 12 months agains prior 12 months. I've managed to create the LTM and PTM measures and this works for the insurer selected in a page slicer. The issue I have is that when certain insurers are selected I need to add back premiums for some products from a different insurer. Something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If insurer A is selected then show LTM and PTM allocated to A&lt;/P&gt;&lt;P&gt;If Insurer B is selected then show LTM and PTM allocated to B plus LTM and PTM for A but only for products 1 and 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do this with measures to calculate the individual amounts and then with a&amp;nbsp;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;TRUE&lt;/SPAN&gt;&lt;SPAN&gt;(), measure. This works for the total, but it also adds to each row throwing those figures out. I'd appreciate if anyone can help me find a way to add only to the relevent product rows.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here are my&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SWITCH&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;TRUE&lt;/SPAN&gt;&lt;SPAN&gt;() formula and the table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total including variations = 
SWITCH( TRUE(),
[Selected Insurer] = "Insurer A", [Total Premium] + [Insurer C Accident &amp;amp; Health Premium] + [Insurer C Professional Risks Premium],
[Selected Insurer] = "Insurer B", [Total Premium] + [Insurer C Marine Premium],
[Total Premium)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 09:59:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variations-affecting-all-rows-in-table/m-p/2566216#M73130</guid>
      <dc:creator>MarkEden</dc:creator>
      <dc:date>2022-06-08T09:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Variations affecting all rows in table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variations-affecting-all-rows-in-table/m-p/2573647#M73622</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398761" data-lia-user-login="MarkEden" class="lia-mention lia-mention-user"&gt;MarkEden&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, in my understanding, you want for example for Insurer B, only when the Risk Class row is Marine, it should be "[Total Premium] + [Insurer C Marine Premium]", otherwise, it should be&amp;nbsp;"[Total Premium]".&lt;/P&gt;
&lt;P&gt;If this is the case, here's my solution.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total including variations =
SWITCH (
    TRUE (),
    [Selected Insurer] = "Insurer A",
        [Total Premium] + [Insurer C Accident &amp;amp; Health Premium] + [Insurer C Professional Risks Premium],
    [Selected Insurer] = "Insurer B",
        IF (
            MAX ( [Risk Class] ) = "Marine",
            [Total Premium] + [Insurer C Marine Premium],
            [Total Premium]
        ),
    [Total Premium]
)
&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 02:52:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variations-affecting-all-rows-in-table/m-p/2573647#M73622</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-06-13T02:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Variations affecting all rows in table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variations-affecting-all-rows-in-table/m-p/2576285#M73777</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="334520" data-lia-user-login="v-yanjiang-msft" class="lia-mention lia-mention-user"&gt;v-yanjiang-msft&lt;/a&gt;&amp;nbsp;thanks for this. I'll test this out. I think it might need a couple more variations but I can see the logic now.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 23:57:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variations-affecting-all-rows-in-table/m-p/2576285#M73777</guid>
      <dc:creator>MarkEden</dc:creator>
      <dc:date>2022-06-13T23:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Variations affecting all rows in table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variations-affecting-all-rows-in-table/m-p/2594073#M74813</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="398761" data-lia-user-login="MarkEden" class="lia-mention lia-mention-user"&gt;MarkEden&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Is your problem solved?? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Community Support Team _ kalyj&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 07:27:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variations-affecting-all-rows-in-table/m-p/2594073#M74813</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-06-22T07:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Variations affecting all rows in table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variations-affecting-all-rows-in-table/m-p/2595983#M74928</link>
      <description>&lt;P&gt;It is. Many thanks for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 23:16:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variations-affecting-all-rows-in-table/m-p/2595983#M74928</guid>
      <dc:creator>MarkEden</dc:creator>
      <dc:date>2022-06-22T23:16:30Z</dc:date>
    </item>
  </channel>
</rss>

