<?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: If Condition for Text not Working in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774716#M3871</link>
    <description>&lt;P&gt;I would try to accomplish this with a measure using a switch statement such as:&lt;BR /&gt;status = switch([status],&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Retired, "Closed"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Submission Declined, "Closed"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Closed with Feedback, "Closed"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;assigned,"Open"&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Aug 2019 20:04:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-08-23T20:04:45Z</dc:date>
    <item>
      <title>If Condition for Text not Working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774712#M3870</link>
      <description>&lt;P&gt;Hey, I have a [Status] Column where I'm trying to consolidate the 7 different types into either Open or Closed. I've tried multiple IF statements, but PBI doesn't seem to be reading my data correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, the following are the status types...&lt;/P&gt;&lt;P&gt;-(Blank)&lt;/P&gt;&lt;P&gt;-Assigned&lt;/P&gt;&lt;P&gt;-Closed with Feedback&lt;/P&gt;&lt;P&gt;-Pending Expert&lt;/P&gt;&lt;P&gt;-Retired&lt;/P&gt;&lt;P&gt;-Submission Declined&lt;/P&gt;&lt;P&gt;-Work in Progress&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Retired, Submission Declined, and Closed with Feedback all need to be grouped into status Classification: Closed. All the others need to be grouped: Open.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My intial formula to test just one did not work: IF(Table1[Status] = "Retired", "Closed", Table1[Status]).&lt;/P&gt;&lt;P&gt;The new row just mirrors the old row. So somehow this is a false statement, I just don't know how to fix it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 19:55:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774712#M3870</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-23T19:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not Working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774716#M3871</link>
      <description>&lt;P&gt;I would try to accomplish this with a measure using a switch statement such as:&lt;BR /&gt;status = switch([status],&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Retired, "Closed"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Submission Declined, "Closed"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Closed with Feedback, "Closed"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;assigned,"Open"&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 20:04:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774716#M3871</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-23T20:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not Working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774718#M3872</link>
      <description>&lt;P&gt;If you wanted to stick with an IF statement it would have to be nested such as:&lt;/P&gt;&lt;P&gt;IF([status] = "retired","Closed",(IF([status] = "Submission Declined","Closed",(IF([status] ="assigned","open",(IF etc.. )))&lt;/P&gt;&lt;P&gt;but that could get long and messy which is why i recomend the switch statement above&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 20:08:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774718#M3872</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-23T20:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not Working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774721#M3873</link>
      <description>&lt;P&gt;So I tested this out for a few of the status...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;switch(Table1[Status],"Retired", "Closed", "Submission Declined", "Closed", "Assigned", "Open").&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This resulted the entire column going to blank. Did I type this in incorrectly or do I have to fill out all of the 7 status for it to work?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Aug 2019 20:20:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774721#M3873</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-23T20:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not Working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774871#M3884</link>
      <description>Such things should be done in Power Query (M), not in DAX. Use the right tool for the job. On top of that, M code would be very simple. No messing around with context and context transition.&lt;BR /&gt;&lt;BR /&gt;DAX is a Data Analysis eXpressions language, not data mash-up language. M is.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D.</description>
      <pubDate>Sat, 24 Aug 2019 12:30:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774871#M3884</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-24T12:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not Working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774921#M3887</link>
      <description>&lt;P&gt;You can use IF in conjunction with OR logical operator as shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a new column:&lt;/P&gt;&lt;P&gt;Final Status = IF( Table1[Status] = "&lt;SPAN&gt;Retired" ||Table1[Status] ="Submission Declined" || Table1[Status] ="Closed with Feedback", "Closed","Open")&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Sat, 24 Aug 2019 18:14:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/774921#M3887</guid>
      <dc:creator>ayushqralgroup</dc:creator>
      <dc:date>2019-08-24T18:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not Working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/775862#M3932</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;wrote:&lt;BR /&gt;Such things should be done in Power Query (M), not in DAX. Use the right tool for the job. On top of that, M code would be very simple. No messing around with context and context transition.&lt;BR /&gt;&lt;BR /&gt;DAX is a Data Analysis eXpressions language, not data mash-up language. M is.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;Thanks for pointing this out. I was not aware of the two langauges.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to use the Replace Value function on the Column inside the Advanced Editor and now it works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#"Replaced Value" = Table.ReplaceValue(#"Duplicated Column","Work In Progress","Open",Replacer.ReplaceText,{"Status - Copy"}),&lt;BR /&gt;#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","Pending Expert","Open",Replacer.ReplaceText,{"Status - Copy"}),&lt;BR /&gt;#"Replaced Value2" = Table.ReplaceValue(#"Replaced Value1","Assigned","Open",Replacer.ReplaceText,{"Status - Copy"}),&lt;BR /&gt;#"Replaced Value3" = Table.ReplaceValue(#"Replaced Value2","Pending Submitter Information","Open",Replacer.ReplaceText,{"Status - Copy"}), ..... etc&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 15:30:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/775862#M3932</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-26T15:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition for Text not Working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/775924#M3941</link>
      <description>&lt;P&gt;Hi there.&lt;BR /&gt;&lt;BR /&gt;Again, this is not the way to do it. First, you should create an auxiliary table that will hold all the mappings from status to classification. Then, in PQ, you left outer join the target table to the mappings table and get the column you need.&lt;BR /&gt;&lt;BR /&gt;This procedure makes sure you don't have to go back to the M code when you need to change a mapping or add a new one. All you have to do is manage the mappings which can be done in the source through SQL (if your data comes from a relational database).&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 16:38:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-Condition-for-Text-not-Working/m-p/775924#M3941</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-26T16:38:04Z</dc:date>
    </item>
  </channel>
</rss>

