<?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 give rules to a measure to either include or exclude text. on a numerical calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-rules-to-a-measure-to-either-include-or-exclude-text/m-p/3302790#M123285</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="556228" data-lia-user-login="LPEquestrian" class="lia-mention lia-mention-user"&gt;LPEquestrian&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;If I understand what the issue is, this may be one way to solve this.&lt;BR /&gt;&lt;BR /&gt;Create two conditional columns in Power Query that essentially filter out the "DHL Only" or "Standard Only" and replace with a zero.&amp;nbsp; Then make those new columns decimal.&amp;nbsp; Then run a find and replace null with zero.&lt;BR /&gt;Then you can use the measure below to do the calcs. (If I have the logic reversed, you could use an extremely large number in Power Query like 10000000 rather than zero, or reverse the &amp;gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Please let me know if you have any issues as to how to do these steps in Power Query. I have included a picture.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Difference =
IF (
    MAX ( Shipping[DHL Derived] ) &amp;gt; MAX ( Shipping[Standard Derived] ),
    MAX ( Shipping[Invoiced Average] ) - MAX ( Shipping[DHL Derived] ),
    MAX ( Shipping[Invoiced Average] ) - MAX ( Shipping[Standard Derived] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;If this solves your issues, please mark it as the &lt;STRONG&gt;solution, &lt;/STRONG&gt;so that others can find it easily. &lt;STRONG&gt;Kudos &lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;are nice too.&lt;BR /&gt;Nathaniel&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2023 16:33:36 GMT</pubDate>
    <dc:creator>Nathaniel_C</dc:creator>
    <dc:date>2023-06-26T16:33:36Z</dc:date>
    <item>
      <title>How to give rules to a measure to either include or exclude text. on a numerical calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-rules-to-a-measure-to-either-include-or-exclude-text/m-p/3300754#M123101</link>
      <description>&lt;P&gt;Hey Everyone, So i am looking at creating a table which includes the Average shipping invoiced cost, calculating the difference in what we actually charge our customers. the problem i cirrently have is a syntax error, i think its due to the fact some spaces have text where we use a certain courier. I.E DHL.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DHL Difference = &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'OPMC Revenue Reporting_2023'&lt;/SPAN&gt;&lt;SPAN&gt;[Invoiced]&lt;/SPAN&gt;&lt;SPAN&gt;) - &lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Sheet1&lt;/SPAN&gt;&lt;SPAN&gt;[DHL]&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;This is the code i have used for my measure, and what it does is take the Invoiced Price - Our charged priced.... trying to give us a difference so we know how much we gain/lose on shipping.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The issue is some of the countries involved only have Standard shipping and this is marked with STD Only.&amp;nbsp; &amp;nbsp;I think where the calculation tried ...... £99.99 - STD Only = ?????? is why i have issues.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;It there anyway to give a rule or filter to a measure to allow it basically to enter the value STD Only or DHL Only. depending on the column?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;BR /&gt;Thanks ! ,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;Lewis&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 24 Jun 2023 14:28:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-rules-to-a-measure-to-either-include-or-exclude-text/m-p/3300754#M123101</guid>
      <dc:creator>LPEquestrian</dc:creator>
      <dc:date>2023-06-24T14:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to give rules to a measure to either include or exclude text. on a numerical calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-rules-to-a-measure-to-either-include-or-exclude-text/m-p/3300879#M123117</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="556228" data-lia-user-login="LPEquestrian" class="lia-mention lia-mention-user"&gt;LPEquestrian&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;£99.99 - STD Only certainly won't work.&amp;nbsp; "&amp;nbsp;this is marked with STD Only" - Where is this marked? Is this in a column? What else is in that column? What is the data type? Please give us more information, so that we may help you solve this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;If this solves your issues, please mark it as the &lt;STRONG&gt;solution, &lt;/STRONG&gt;so that others can find it easily. &lt;STRONG&gt;Kudos &lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;are nice too.&lt;BR /&gt;Nathaniel&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2023 23:53:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-rules-to-a-measure-to-either-include-or-exclude-text/m-p/3300879#M123117</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2023-06-24T23:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to give rules to a measure to either include or exclude text. on a numerical calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-rules-to-a-measure-to-either-include-or-exclude-text/m-p/3301911#M123205</link>
      <description>&lt;P&gt;Hi Nathaniel,&lt;BR /&gt;&lt;BR /&gt;So from my Data sets, I have 2 sets , 1 which has "Date/Country/Invoiced Price/Shipments sent" and the second set which has "Country/DHL Price/STND Price"&amp;nbsp; These are the prices we charge to the countries.&lt;BR /&gt;&lt;BR /&gt;So the columns featuring the text also feature a number which is a price... the meaning behind this is some countries we only offer 1 service... so for example Australia, We offer DHL Only... the 2 columns will represent that&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What i am trying to achieve is, we take the value of Invoiced Price "Minus" the cheapest shipping option we offer.&amp;nbsp; This is then to be displayed in another coloumn in the table stating "Difference" which displays in a currency value,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Type would be Currency, but im assuming as there is text present i have lost the option to set a column as currency. as it "Errors" all my text data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an example of what im trying to achieve. I just filled in a few to show an example of what id like to see happen. Essentially if text is present i want it to bypass and then run the calculation on the available numbers.... and to filter to choose smallest number if 2 are present.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;  Hopes this answers what you've asked.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 08:18:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-rules-to-a-measure-to-either-include-or-exclude-text/m-p/3301911#M123205</guid>
      <dc:creator>LPEquestrian</dc:creator>
      <dc:date>2023-06-26T08:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to give rules to a measure to either include or exclude text. on a numerical calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-rules-to-a-measure-to-either-include-or-exclude-text/m-p/3302790#M123285</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="556228" data-lia-user-login="LPEquestrian" class="lia-mention lia-mention-user"&gt;LPEquestrian&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;If I understand what the issue is, this may be one way to solve this.&lt;BR /&gt;&lt;BR /&gt;Create two conditional columns in Power Query that essentially filter out the "DHL Only" or "Standard Only" and replace with a zero.&amp;nbsp; Then make those new columns decimal.&amp;nbsp; Then run a find and replace null with zero.&lt;BR /&gt;Then you can use the measure below to do the calcs. (If I have the logic reversed, you could use an extremely large number in Power Query like 10000000 rather than zero, or reverse the &amp;gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Please let me know if you have any issues as to how to do these steps in Power Query. I have included a picture.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Difference =
IF (
    MAX ( Shipping[DHL Derived] ) &amp;gt; MAX ( Shipping[Standard Derived] ),
    MAX ( Shipping[Invoiced Average] ) - MAX ( Shipping[DHL Derived] ),
    MAX ( Shipping[Invoiced Average] ) - MAX ( Shipping[Standard Derived] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;Let me know if you have any questions.&lt;BR /&gt;&lt;BR /&gt;If this solves your issues, please mark it as the &lt;STRONG&gt;solution, &lt;/STRONG&gt;so that others can find it easily. &lt;STRONG&gt;Kudos &lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;are nice too.&lt;BR /&gt;Nathaniel&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 16:33:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-rules-to-a-measure-to-either-include-or-exclude-text/m-p/3302790#M123285</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2023-06-26T16:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to give rules to a measure to either include or exclude text. on a numerical calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-rules-to-a-measure-to-either-include-or-exclude-text/m-p/3302793#M123286</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="556228" data-lia-user-login="LPEquestrian" class="lia-mention lia-mention-user"&gt;LPEquestrian&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 16:37:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-give-rules-to-a-measure-to-either-include-or-exclude-text/m-p/3302793#M123286</guid>
      <dc:creator>Nathaniel_C</dc:creator>
      <dc:date>2023-06-26T16:37:33Z</dc:date>
    </item>
  </channel>
</rss>

