<?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 If Condition for Text not recognizing column name in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2199563#M51600</link>
    <description>&lt;P&gt;I have a text column USERID for which I want to determine part of a USERID based on IF condition. However, I tried as both column and measure, but getting error "can not find column, please use aggregate function". How do I apply aggregate function on text column? I need to work in &lt;STRONG&gt;DirectQuery&lt;/STRONG&gt; mode only.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Nov 2021 18:51:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-11-20T18:51:32Z</dc:date>
    <item>
      <title>If Condition for Text not recognizing column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2199563#M51600</link>
      <description>&lt;P&gt;I have a text column USERID for which I want to determine part of a USERID based on IF condition. However, I tried as both column and measure, but getting error "can not find column, please use aggregate function". How do I apply aggregate function on text column? I need to work in &lt;STRONG&gt;DirectQuery&lt;/STRONG&gt; mode only.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 18:51:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2199563#M51600</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-20T18:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not recognizing column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2199576#M51602</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use MAX(Sessions[column name] in the measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;helps&lt;/SPAN&gt;&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;accepting&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;it as the solution&lt;/SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;Appreciate your Kudos!!&lt;BR /&gt;&lt;STRONG&gt;LinkedIn:&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 13:55:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2199576#M51602</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-11-20T13:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not recognizing column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2199697#M51613</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you for your response, but when I try putting aggreagte function like MAX(Sessions[column name]) I get error 'can not convert value of type text to Number'.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to work in &lt;STRONG&gt;DirectQuery&lt;/STRONG&gt; mode only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I believe to apply aggregate function it needs to be numberic data, however my column contains text.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 18:53:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2199697#M51613</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-20T18:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not recognizing column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2199772#M51618</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Indeed MAX will not work with text. I am not sure about the expected result but you could try FIRSTNONBLANKVALUE, which is an aggregation that works on text columns and gives (like the name implies) the first value.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jeroen&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 22:44:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2199772#M51618</guid>
      <dc:creator>jeroendekk</dc:creator>
      <dc:date>2021-11-20T22:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not recognizing column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2199776#M51619</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="132282" data-lia-user-login="jeroendekk" class="lia-mention lia-mention-user"&gt;jeroendekk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;FYI:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 22:56:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2199776#M51619</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-11-20T22:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not recognizing column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2202101#M51708</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Known Visitor Id = &lt;/SPAN&gt;&lt;SPAN&gt;RIGHT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sessions'[Known Visitor Id]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;LEN&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sessions'[Known Visitor Id]&lt;/SPAN&gt;&lt;SPAN&gt;) - &lt;/SPAN&gt;&lt;SPAN&gt;FIND&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"\"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Sessions'[Known Visitor Id]&lt;/SPAN&gt;&lt;SPAN&gt;))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;However I am getting error:&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 18:08:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2202101#M51708</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-22T18:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not recognizing column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2203285#M51759</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your DAX formula and error message, it seems that the problem occurs because of one missing parenthesis in the function LEN(MAX('Sessions'[Known Visitor Id]):&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you to change the DAX formula like this and check if the problem can disappear:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Known Visitor Id = 

RIGHT(MAX('Sessions'[Known Visitor Id]),LEN(MAX('Sessions'[Known Visitor Id])) - FIND("\",MAX('Sessions'[Known Visitor Id])))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you can get what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you still have a problem, you can post some sample data(without sensitive data) and your expected result.&lt;/P&gt;
&lt;P&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;/P&gt;
&lt;P&gt;Thank you very much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Robert Qin&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 09:13:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2203285#M51759</guid>
      <dc:creator>v-robertq-msft</dc:creator>
      <dc:date>2021-11-23T09:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not recognizing column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2203368#M51761</link>
      <description>&lt;P&gt;Oops sorry, apparently you can. Learned something new thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 09:40:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2203368#M51761</guid>
      <dc:creator>jeroendekk</dc:creator>
      <dc:date>2021-11-23T09:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not recognizing column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2204575#M51838</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Known Visitor Id =
RIGHT (
    MAX ( 'Sessions'[Known Visitor Id] ),
    LEN ( MAX ( 'Sessions'[Known Visitor Id] ) )
        - FIND ( "\", MAX ( 'Sessions'[Known Visitor Id] ) )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it doesn't work, then please share a sample of your data.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;helps&lt;/SPAN&gt;&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;accepting&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;it as the solution&lt;/SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;Appreciate your Kudos!!&lt;BR /&gt;&lt;STRONG&gt;LinkedIn:&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 23:07:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2204575#M51838</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-11-23T23:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not recognizing column name</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2204915#M51846</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad to hear that you have solved your problem with the help of VahidDM, would you like to mark his reply as a solution so that others can learn from it too?&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;
&lt;P&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;/P&gt;
&lt;P&gt;&lt;U&gt;&amp;nbsp;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Robert Qin&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Nov 2021 03:43:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-recognizing-column-name/m-p/2204915#M51846</guid>
      <dc:creator>v-robertq-msft</dc:creator>
      <dc:date>2021-11-24T03:43:45Z</dc:date>
    </item>
  </channel>
</rss>

