<?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: Can you provide alternate dax without using SWITCH statement? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890480#M151736</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;If you insist on a measure, then try this one&lt;/P&gt;
&lt;P&gt;Measure = if(hasonevalue(Data[Region]),if(min(Data[Region])="North America"||min(Data[Region])="Europe","Developed Markets",if(min(Data[Region])="Asia"||min(Data[Region])="South America","Emerging Markets","Other")),blank())&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Sat, 04 May 2024 08:14:25 GMT</pubDate>
    <dc:creator>Ashish_Mathur</dc:creator>
    <dc:date>2024-05-04T08:14:25Z</dc:date>
    <item>
      <title>Can you provide alternate dax without using SWITCH statement?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890433#M151731</link>
      <description>&lt;P&gt;Suppose you have a table called Sales with columns for Region, Product, and Revenue.&lt;BR /&gt;You need to create a measure that categorizes the Revenue based on the Region using the following criteria:&lt;BR /&gt;&lt;BR /&gt;If the Region is "North America" or "Europe", categorize the Revenue as "Developed Markets".&lt;BR /&gt;If the Region is "Asia" or "South America", categorize the Revenue as "Emerging Markets".&lt;BR /&gt;If the Region is anything else, categorize the Revenue as "Other Markets".&lt;BR /&gt;hope you can provide alternate result?&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="19851" data-lia-user-login="Ashish_Mathur" class="lia-mention lia-mention-user"&gt;Ashish_Mathur&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 07:41:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890433#M151731</guid>
      <dc:creator>Maha_0221</dc:creator>
      <dc:date>2024-05-04T07:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can you provide alternate dax without using SWITCH statement?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890456#M151732</link>
      <description>&lt;P&gt;You can create another table that has region and category and either merge them or use a relationship, but what is the issue in creating a calculated column with SWITCH?&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 07:40:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890456#M151732</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2024-05-04T07:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can you provide alternate dax without using SWITCH statement?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890458#M151733</link>
      <description>&lt;P&gt;report performance issue&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 07:42:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890458#M151733</guid>
      <dc:creator>Maha_0221</dc:creator>
      <dc:date>2024-05-04T07:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can you provide alternate dax without using SWITCH statement?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890461#M151734</link>
      <description>&lt;P&gt;Create a calculated column not a measure&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 07:43:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890461#M151734</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2024-05-04T07:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can you provide alternate dax without using SWITCH statement?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890462#M151735</link>
      <description>&lt;P&gt;this was asked in interview so he want best answer for this question&lt;BR /&gt;&lt;BR /&gt;Categorize_Revenue= switch(allselected(sales(region),{"North America","Europe"},"Developed Markets", {"Asia" or "South america"},"Emerging markets",other markets))&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 08:51:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890462#M151735</guid>
      <dc:creator>Maha_0221</dc:creator>
      <dc:date>2024-05-04T08:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can you provide alternate dax without using SWITCH statement?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890480#M151736</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;If you insist on a measure, then try this one&lt;/P&gt;
&lt;P&gt;Measure = if(hasonevalue(Data[Region]),if(min(Data[Region])="North America"||min(Data[Region])="Europe","Developed Markets",if(min(Data[Region])="Asia"||min(Data[Region])="South America","Emerging Markets","Other")),blank())&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sat, 04 May 2024 08:14:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3890480#M151736</guid>
      <dc:creator>Ashish_Mathur</dc:creator>
      <dc:date>2024-05-04T08:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can you provide alternate dax without using SWITCH statement?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3897523#M151885</link>
      <description>&lt;P&gt;&lt;FONT&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="724202" data-lia-user-login="Maha_0221" class="lia-mention lia-mention-user"&gt;Maha_0221&lt;/a&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="19851" data-lia-user-login="Ashish_Mathur" class="lia-mention lia-mention-user"&gt;Ashish_Mathur&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="236628" data-lia-user-login="AntrikshSharma" class="lia-mention lia-mention-user"&gt;AntrikshSharma&lt;/a&gt;&amp;nbsp;Thank you very much for your prompt reply. Allow me to offer a different approach here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="724202" data-lia-user-login="Maha_0221" class="lia-mention lia-mention-user"&gt;Maha_0221&lt;/a&gt;&amp;nbsp;For your question, here is the method I provided:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some dummy data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;“&lt;SPAN&gt;Sales&lt;/SPAN&gt;”&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can create a measure.&amp;nbsp;By calling a variable and making an if judgment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
VAR _REGION = SELECTEDVALUE('Sales'[region])
RETURN
IF(
    _REGION in {"North America", "Europe"}, 
    "Developed Narkets",
    IF(
        _REGION in {"Asia", "South America"},
        "Emerging Markets",
        "Other Markets"))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using variables can better help you minimize the impact on performance.&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 06:29:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Can-you-provide-alternate-dax-without-using-SWITCH-statement/m-p/3897523#M151885</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-07T06:29:31Z</dc:date>
    </item>
  </channel>
</rss>

