<?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: Add new Conditional Column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-new-Conditional-Column/m-p/2264802#M54833</link>
    <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Did these suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If these also don't help, please share more detailed information to help us clarify your scenario to test.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jan 2022 05:56:36 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-01-04T05:56:36Z</dc:date>
    <item>
      <title>Add new Conditional Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-new-Conditional-Column/m-p/2260288#M54638</link>
      <description>&lt;P&gt;I have a table like below,&lt;/P&gt;&lt;P&gt;2 types of products. I want the last column Margin as calculated like:&lt;/P&gt;&lt;P&gt;For A: It is Revenue - T Price&lt;/P&gt;&lt;P&gt;&amp;amp; For B: It is Revenue - M Price.&lt;/P&gt;&lt;P&gt;How do I set up the Margin column to get the above conditions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Product type&lt;/TD&gt;&lt;TD&gt;Revenue&lt;/TD&gt;&lt;TD&gt;T Price&lt;/TD&gt;&lt;TD&gt;M Price&lt;/TD&gt;&lt;TD&gt;Margin&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;36&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;40-36&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;54&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;54-50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;32&lt;/TD&gt;&lt;TD&gt;28&lt;/TD&gt;&lt;TD&gt;27&lt;/TD&gt;&lt;TD&gt;32-27&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;43&lt;/TD&gt;&lt;TD&gt;40&lt;/TD&gt;&lt;TD&gt;38&lt;/TD&gt;&lt;TD&gt;43-38&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;33&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;33-30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;29&lt;/TD&gt;&lt;TD&gt;27&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;TD&gt;29-25&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 30 Dec 2021 00:51:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-new-Conditional-Column/m-p/2260288#M54638</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-30T00:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Add new Conditional Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-new-Conditional-Column/m-p/2260293#M54639</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp; you can write a measure like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
SWITCH (
    TRUE (),
    MAX ( 'Table 1'[Product type] ) = "A", SUM ( 'Table 1'[Revenue] ) - SUM ( 'Table 1'[T Price] ),
    MAX ( 'Table 1'[Product type] ) = "B", SUM ( 'Table 1'[Revenue] ) - SUM ( 'Table 1'[M Price] )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&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;or a calculated column&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = SWITCH (
    TRUE (),
     'Table 1'[Product type]  = "A",'Table 1'[Revenue]-  'Table 1'[T Price] ,
     'Table 1'[Product type]  = "B",  'Table 1'[Revenue]  -  'Table 1'[M Price] 
)&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2021 01:05:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-new-Conditional-Column/m-p/2260293#M54639</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2021-12-30T01:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Add new Conditional Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-new-Conditional-Column/m-p/2260516#M54645</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The below is one of ways to create a calculated column.&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;DIV&gt;
&lt;DIV&gt;&lt;STRONG&gt;&lt;EM&gt;Margin CC = &lt;/EM&gt;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;EM&gt;IF(&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;EM&gt;Data[Product type] = "A" , Data[Revenue] - Data[T Price] ,&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;EM&gt;IF ( Data[Product type] = "B" , Data[Revenue] - Data[M Price] ,&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;EM&gt;BLANK()&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;EM&gt; )&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Dec 2021 04:04:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-new-Conditional-Column/m-p/2260516#M54645</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2021-12-30T04:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: Add new Conditional Column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-new-Conditional-Column/m-p/2264802#M54833</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Did these suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;If these also don't help, please share more detailed information to help us clarify your scenario to test.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;&lt;A href="http://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&amp;nbsp;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 05:56:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Add-new-Conditional-Column/m-p/2264802#M54833</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-04T05:56:36Z</dc:date>
    </item>
  </channel>
</rss>

