<?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 Column With Switch Statement Errors in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271758#M169440</link>
    <description>&lt;P&gt;Well it just shows up as a field in the table 'Subscriber Activity'.&amp;nbsp; I don't see any query.&amp;nbsp; I was just given access to this&amp;nbsp; a couple weeks ago, so I'm not certain if i have any other access except building reports if that makes sense.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2024 04:15:46 GMT</pubDate>
    <dc:creator>BrianNeedsHelp</dc:creator>
    <dc:date>2024-11-06T04:15:46Z</dc:date>
    <item>
      <title>New Column With Switch Statement Errors</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271626#M169428</link>
      <description>&lt;P&gt;I have this Switch Statement that I put in a measure and it works fine in the measure for showing the results of "Low", Med", High".&amp;nbsp; But I wanted to use the same formula in a column so that I could use it in a slicer and I'm getting this error when I select it to add to the visual.&amp;nbsp; "The column week number specified in the 'SUMMARIZE' function was not found in the input table.&amp;nbsp; &amp;nbsp;??? I don't have any Summarize function.&amp;nbsp; Makes no sense.&amp;nbsp; Any ideas?&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GACategory = SWITCH(
                  TRUE(),
             [Gross Adds]&amp;lt;=45,"Low",
             [Gross Adds]&amp;gt;=45 || [Gross Adds]&amp;lt;=70,"Mid",
             [Gross Adds]&amp;gt;70, "High"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 02:12:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271626#M169428</guid>
      <dc:creator>BrianNeedsHelp</dc:creator>
      <dc:date>2024-11-06T02:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: New Column With Switch Statement Errors</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271643#M169432</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you share the details of&amp;nbsp; [Gross Adds]?&lt;/P&gt;
&lt;P&gt;BTW, can you use the column name rather than the measure refrence in the calculated column or add that measure explanation directly in the calculated column DAX query?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank" rel="noopener noreferrer"&gt;LinkedIn&lt;/A&gt; | &lt;A href="https://twitter.com/VahidDMcom" target="_blank" rel="noopener noreferrer"&gt;Twitter&lt;/A&gt; | &lt;A href="https://www.vahiddm.com/" target="_blank" rel="noopener noreferrer"&gt;Blog&amp;nbsp;&lt;/A&gt;| &lt;A href="https://www.youtube.com/channel/UCF-uQfGF8de-EWnR9b2UQhQ" target="_blank" rel="noopener noreferrer"&gt;YouTube&lt;/A&gt;&lt;A href="https://www.youtube.com/channel/UCF-uQfGF8de-EWnR9b2UQhQ" target="_blank" rel="noopener noreferrer"&gt;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 02:20:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271643#M169432</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2024-11-06T02:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: New Column With Switch Statement Errors</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271720#M169436</link>
      <description>&lt;P&gt;Hi.&amp;nbsp; [Gross Adds] is like an aggretate of new subscribers to a newspaper.&amp;nbsp; I'm not sure what you mean by adding that measure explanation directly. I'm new to this, so i just clicked on add column and named it GACategory.&amp;nbsp; It put an fx next to the name and I just checkmark the box to add it to the visual.&amp;nbsp; That's when the whole visual goes blank and i get that error.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 03:21:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271720#M169436</guid>
      <dc:creator>BrianNeedsHelp</dc:creator>
      <dc:date>2024-11-06T03:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: New Column With Switch Statement Errors</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271753#M169438</link>
      <description>&lt;P&gt;Would you please share that&amp;nbsp;&lt;SPAN&gt;[Gross Adds] DAX query here?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 04:10:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271753#M169438</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2024-11-06T04:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: New Column With Switch Statement Errors</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271758#M169440</link>
      <description>&lt;P&gt;Well it just shows up as a field in the table 'Subscriber Activity'.&amp;nbsp; I don't see any query.&amp;nbsp; I was just given access to this&amp;nbsp; a couple weeks ago, so I'm not certain if i have any other access except building reports if that makes sense.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 04:15:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271758#M169440</guid>
      <dc:creator>BrianNeedsHelp</dc:creator>
      <dc:date>2024-11-06T04:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: New Column With Switch Statement Errors</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271998#M169446</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="828752" data-lia-user-login="BrianNeedsHelp" class="lia-mention lia-mention-user"&gt;BrianNeedsHelp&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;In DAX, measures and calculated columns serve different purposes and contexts. Unfortunately, you cannot directly use a measure in a calculated column because measures are evaluated in the context of the entire dataset, while calculated columns are evaluated row by row within a table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You need to ensure that the logic used in your measure is translated into a row-by-row context.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can try this:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GACategory = 
VAR GrossAddsValue = [Gross Adds] -- Replace this with the logic to calculate Gross Adds for each row
RETURN SWITCH(
    TRUE(),
    GrossAddsValue &amp;lt;= 45, "Low",
    GrossAddsValue &amp;gt; 45 &amp;amp;&amp;amp; GrossAddsValue &amp;lt;= 70, "Mid",
    GrossAddsValue &amp;gt; 70, "High"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!!&lt;/P&gt;&lt;P&gt;If this solved your problem, please accept it as a solution and a kudos!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;BR /&gt;Shahariar Hafiz&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2024 06:50:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4271998#M169446</guid>
      <dc:creator>shafiz_p</dc:creator>
      <dc:date>2024-11-06T06:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: New Column With Switch Statement Errors</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4273718#M169542</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="828752" data-lia-user-login="BrianNeedsHelp" class="lia-mention lia-mention-user"&gt;BrianNeedsHelp&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my experience, it should be a field in the calculation table, and perhaps this case requires aggregation or other adjustments.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope it helps!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Community Support Team_ Scott Chang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 09:21:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4273718#M169542</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-07T09:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: New Column With Switch Statement Errors</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4274167#M169565</link>
      <description>&lt;P&gt;I think there was another visual causing errors.&amp;nbsp; &amp;nbsp;So I started over on another tab, and put this in like you mentioned:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;GACategory = 
VAR GAs = sumx(VALUES('Location'[Location]),[Gross Adds])
REturn
SWITCH(
                  TRUE(),
             GAs&amp;lt;=45,"Low",
       GAs&amp;gt;=45 &amp;amp;&amp;amp;  GAs&amp;lt;=70,"Mid",
             GAs&amp;gt;70, "High"
)&lt;/LI-CODE&gt;&lt;P&gt;Now I'm getting "this query uses more memory than the limit".&amp;nbsp; So it may be that I need to query it down further?&amp;nbsp; Not certain but the same thing works perfect in a measure.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 14:03:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4274167#M169565</guid>
      <dc:creator>BrianNeedsHelp</dc:creator>
      <dc:date>2024-11-07T14:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: New Column With Switch Statement Errors</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4274520#M169582</link>
      <description>&lt;P&gt;Your used functions are quite memory-intensive especially with large datasets. Anyway, if possible please share pbix. Without knowing what you are trying to achieve it is hard to give solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solution provided earlier was not any concreate solution. Just want you to remember, that calculated column works row by row. It checks that the current row satisfy condition, if, then put it in calculation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know about your [Gross Adds] measure or it is a column or not. You are summing up gross adds for each location and then compare value to tagging each row (In which table). So, what is the relation between each row (where this column will be developed) and the gross adds, not very clear.&lt;BR /&gt;&lt;BR /&gt;For example, I have a product table with price column where each row is a complete product info. I want to tag price with Low, Mid and High. I would then do simple:&lt;BR /&gt;&lt;BR /&gt;Category =&lt;BR /&gt;SWITCH (&lt;BR /&gt;TRUE(),&lt;BR /&gt;Product[Price] &amp;lt;= 100, "Low",&lt;BR /&gt;Product[Price] &amp;gt; 100 &amp;amp;&amp;amp; Product[Price] &amp;lt;= 500, "Mid",&lt;BR /&gt;"High"&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 18:38:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4274520#M169582</guid>
      <dc:creator>shafiz_p</dc:creator>
      <dc:date>2024-11-07T18:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: New Column With Switch Statement Errors</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4275165#M169606</link>
      <description>&lt;P&gt;Define a new range table say RangeTable with the following columns and values&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Display  | Min | Max
"Low"    |   1 | 45
"Mid"    |  46 | 70
"High"   |  71 | 1000000000 (Or any other maximum value)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;And then use the following in your calculated column :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE (
VALUES ( 'RangeTable '[Display] ),
FILTER (
'RangeTable',
'YourTable'[Gross Adds] &amp;gt;= 'RangeTable'[Min]
&amp;amp;&amp;amp; 'YourTable'[Gross Adds] &amp;lt;= 'RangeTable'[Max]
)
)&lt;/LI-CODE&gt;&lt;P&gt;and also your formula has an error.&lt;BR /&gt;&lt;BR /&gt;When the "Gross Adds" has a value of 45 it would satisfy condition for both Low and High&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; [Gross Adds]&amp;lt;=45,"Low",
             [Gross Adds]&amp;gt;=45 || [Gross Adds]&amp;lt;=70,"Mid",
             [Gross Adds]&amp;gt;70, "High"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 07:18:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/New-Column-With-Switch-Statement-Errors/m-p/4275165#M169606</guid>
      <dc:creator>SachinNandanwar</dc:creator>
      <dc:date>2024-11-08T07:18:29Z</dc:date>
    </item>
  </channel>
</rss>

