<?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: How to remove garbage values or scripted value from a column in calculated table? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-garbage-values-or-scripted-value-from-a-column-in/m-p/2450211#M65914</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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here the DAX:&lt;/P&gt;&lt;PRE&gt;Column = 
IF ( Table[Country] = "US", 
    SUBSTITUTE (
        SUBSTITUTE (
            SUBSTITUTE ( Table[Product], "-US", "" )
            , "{""en"":""", ""
        )
        , """}", ""
    ),
    ""
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;I do not think you need an OR, at least not in the case that you are describing above. You can just add a step beforehand to make the values look alike. I.e. in the DAX above you can see that we first removed "-US" from the string. Afterwards, it has the exact same structure.&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;DAX really is not the right tool for string interpolation / manipluation. As already said yesterday, this should be done in PQ. Further, calculating tables can also be done in PQ, so there should indeed be a decent chance that your calculated table can already be created in PQ. You might wanna consider posting that in the Power Query Forum &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;Hope this helps anyway &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Apr 2022 17:01:18 GMT</pubDate>
    <dc:creator>tackytechtom</dc:creator>
    <dc:date>2022-04-11T17:01:18Z</dc:date>
    <item>
      <title>How to remove garbage values or scripted value from a column in calculated table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-garbage-values-or-scripted-value-from-a-column-in/m-p/2447788#M65763</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I need help with&amp;nbsp;removing garbage values or scripted value from a column in calculated table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Calculated Table:&lt;/STRONG&gt; Products&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Current Column:&lt;/STRONG&gt; Product&lt;/P&gt;&lt;P&gt;Trying to create a new calculated column: Product Name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Product&lt;/TD&gt;&lt;TD&gt;Product Name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;{"cs-CZ":"10x iD POLAR GREEN","cs":"10x iD POLAR GREEN"}&lt;/TD&gt;&lt;TD&gt;10x iD POLAR GREEN:10x iD POLAR GREEN&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;{"cs-CZ":"Čisticí tampóny","cs":"Čisticí Tampóny"}&lt;/TD&gt;&lt;TD&gt;Čisticí tampóny:Čisticí Tampóny&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;{"cs-CZ":"Čisticí tyčinky","cs":"Čisticí Tampóny"}&lt;/TD&gt;&lt;TD&gt;Čisticí tyčinky:Čisticí Tampóny&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not possible in Power Query as this is a calculated table.&amp;nbsp;Could someone help me with DAX expression?&lt;/P&gt;</description>
      <pubDate>Sun, 10 Apr 2022 18:00:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-garbage-values-or-scripted-value-from-a-column-in/m-p/2447788#M65763</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-10T18:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove garbage values or scripted value from a column in calculated table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-garbage-values-or-scripted-value-from-a-column-in/m-p/2447793#M65764</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 class="lia-align-justify"&gt;As you said yourself, Power Query would be a much better option, but if it really does not work to create the calculated table in PQ, here a possible solution:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here the code:&lt;/P&gt;&lt;PRE&gt;Column = 
SUBSTITUTE (
    SUBSTITUTE ( 
        SUBSTITUTE ( 
            SUBSTITUTE ( Table6[Product], "{""cs-CZ"":""", "" )
            , """,""cs""", "" 
        )
        ,"""", "" 
    )
    , "}", ""
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this solve your issue? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank" rel="noopener"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank" rel="noopener"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Apr 2022 18:31:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-garbage-values-or-scripted-value-from-a-column-in/m-p/2447793#M65764</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2022-04-10T18:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove garbage values or scripted value from a column in calculated table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-garbage-values-or-scripted-value-from-a-column-in/m-p/2448360#M65811</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="353745" data-lia-user-login="tackytechtom" class="lia-mention lia-mention-user"&gt;tackytechtom&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Thanks this is helping me to some extent but if the country is having two different types of script language it is working partially.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For eg: if "US" country is having two different types of script as shown below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The formulae I am using for calculated column is :&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;Product Name&lt;/STRONG&gt; = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;I tried to add OR check but it is throwing error. Could you please help me here?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Apr 2022 05:18:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-garbage-values-or-scripted-value-from-a-column-in/m-p/2448360#M65811</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-11T05:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove garbage values or scripted value from a column in calculated table?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-garbage-values-or-scripted-value-from-a-column-in/m-p/2450211#M65914</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;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here the DAX:&lt;/P&gt;&lt;PRE&gt;Column = 
IF ( Table[Country] = "US", 
    SUBSTITUTE (
        SUBSTITUTE (
            SUBSTITUTE ( Table[Product], "-US", "" )
            , "{""en"":""", ""
        )
        , """}", ""
    ),
    ""
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;I do not think you need an OR, at least not in the case that you are describing above. You can just add a step beforehand to make the values look alike. I.e. in the DAX above you can see that we first removed "-US" from the string. Afterwards, it has the exact same structure.&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;DAX really is not the right tool for string interpolation / manipluation. As already said yesterday, this should be done in PQ. Further, calculating tables can also be done in PQ, so there should indeed be a decent chance that your calculated table can already be created in PQ. You might wanna consider posting that in the Power Query Forum &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;Hope this helps anyway &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-justify"&gt;/Tom&lt;BR /&gt;&lt;A href="https://www.tackytech.blog/" target="_blank"&gt;https://www.tackytech.blog/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.instagram.com/tackytechtom/" target="_blank"&gt;https://www.instagram.com/tackytechtom/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 17:01:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-remove-garbage-values-or-scripted-value-from-a-column-in/m-p/2450211#M65914</guid>
      <dc:creator>tackytechtom</dc:creator>
      <dc:date>2022-04-11T17:01:18Z</dc:date>
    </item>
  </channel>
</rss>

