<?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: Check to see if value in home table is greater than Limit table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3717949#M144753</link>
    <description>&lt;P&gt;Hello, upon further testing there is one issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code works unless there is a [UnitType] that does not exist, if that is the case the result should be blank, but it shows a record.&amp;nbsp; as seen in the screen shot, there is no unit type of what is listed there but it is showing a flag?&amp;nbsp; The last column in this table is being pulled from the related table which shows nothing for a unit type.&amp;nbsp; The export table shows a unit type so my expected response would be, if there is no correlating unit type in my limits table, there should be no flag red or yel.&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;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Feb 2024 18:36:29 GMT</pubDate>
    <dc:creator>JKraft100</dc:creator>
    <dc:date>2024-02-22T18:36:29Z</dc:date>
    <item>
      <title>Check to see if value in home table is greater than Limit table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3712767#M144459</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have Table 'Export'[iron] which contains a value and also has a 'Export'[UnitType] assigned to that same dataset.&amp;nbsp; I have a limit table 'UnitTypeLimits'[Unit Type] and a column that has the limit 'UnitTypeLimits'[Fe]. I am looking to say use the 'Export'[UnitType] value, lets say it is "Axle", go to the&amp;nbsp;'UnitTypeLimits'[Fe] column and look for the row that contains "Axle" and check&amp;nbsp;'Export'[iron] against the&amp;nbsp;'UnitTypeLimits'[Fe] value and see if it is greater.&amp;nbsp; If it is greater, return "Red"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone want to give it a try, I can't get the two tables to link up right.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;AND&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;('Export'[UnitType]) == &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(UnitTypeLimits[Unit Type]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;('Export'[Iron]) &amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(UnitTypeLimits[Fe])),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 21 Feb 2024 02:20:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3712767#M144459</guid>
      <dc:creator>JKraft100</dc:creator>
      <dc:date>2024-02-21T02:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if value in home table is greater than Limit table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3714462#M144559</link>
      <description>&lt;P&gt;No need to link them, use TREATAS to transfer filters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 14:16:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3714462#M144559</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-21T14:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if value in home table is greater than Limit table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3714666#M144564</link>
      <description>&lt;P&gt;Hi Ibendlin,&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First Table is called "Export", It houses all raw data.&amp;nbsp; I want have a relationship between 'Export'[UnitType] and 'UnitTypeLimits'[Unit Type].&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;SampleID&lt;/TD&gt;&lt;TD&gt;UnitType&lt;/TD&gt;&lt;TD&gt;Iron&lt;/TD&gt;&lt;TD&gt;Chrome&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1688812&lt;/TD&gt;&lt;TD&gt;Axle&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1688813&lt;/TD&gt;&lt;TD&gt;Axle&lt;/TD&gt;&lt;TD&gt;31&lt;/TD&gt;&lt;TD&gt;19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1688814&lt;/TD&gt;&lt;TD&gt;Engine - Diesel&lt;/TD&gt;&lt;TD&gt;88&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1688815&lt;/TD&gt;&lt;TD&gt;Engine - Gasoline&lt;/TD&gt;&lt;TD&gt;120&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second table is called "UnitTypeLimits"&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Unit Type&lt;/TD&gt;&lt;TD&gt;Fe_Yel&lt;/TD&gt;&lt;TD&gt;Fe_Red&lt;/TD&gt;&lt;TD&gt;Cr_Yel&lt;/TD&gt;&lt;TD&gt;Cr_Red&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Axle&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Engine - Diesel&lt;/TD&gt;&lt;TD&gt;80&lt;/TD&gt;&lt;TD&gt;125&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Engine - Gasoline&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Differential&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;TD&gt;25&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I looking to product a column in 'Export' that is [Fe_Flag] and that houses a "1" or "2" number or "Yellow" or "Red" based on 'export' data.&amp;nbsp; IT would compare the value based on the unit type and see if the value is greater than the value listed in the 'UnitTypeLimit' table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would say loop through the [SampleId] take the [UnitType] and check if the [Fe_yel] or [Fe_Red] applies or NA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected result would look like this 'Export' table.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;SampleId&lt;/TD&gt;&lt;TD&gt;UnitType&lt;/TD&gt;&lt;TD&gt;Iron&lt;/TD&gt;&lt;TD&gt;Fe_Flag&lt;/TD&gt;&lt;TD&gt;Chrome&lt;/TD&gt;&lt;TD&gt;Cr_Flag&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1688812&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Axle&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;NA&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Yellow&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1688813&lt;/TD&gt;&lt;TD&gt;Axle&lt;/TD&gt;&lt;TD&gt;31&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Red&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;19&lt;/TD&gt;&lt;TD&gt;Red&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1688814&lt;/TD&gt;&lt;TD&gt;Engine - Diesel&lt;/TD&gt;&lt;TD&gt;88&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;NA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1688815&lt;/TD&gt;&lt;TD&gt;Engine - Gasoline&lt;/TD&gt;&lt;TD&gt;120&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;NA&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for looking deeper.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 15:22:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3714666#M144564</guid>
      <dc:creator>JKraft100</dc:creator>
      <dc:date>2024-02-21T15:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if value in home table is greater than Limit table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3715871#M144630</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="693539" data-lia-user-login="JKraft100" class="lia-mention lia-mention-user"&gt;JKraft100&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Fe_Flag =
var _feyel=
SUMX(
    FILTER(ALL('UnitTypeLimits'),'UnitTypeLimits'[Unit Type]=EARLIER('Export'[UnitType])),[Fe_Yel])
var _fered=
SUMX(
    FILTER(ALL('UnitTypeLimits'),'UnitTypeLimits'[Unit Type]=EARLIER('Export'[UnitType])),[Fe_Red])
return
SWITCH(
    TRUE(),
    [Iron]&amp;lt;_feyel,"NA",
    [Iron]&amp;gt;=_fered,"Red",
    [Iron]&amp;gt;=_feyel&amp;amp;&amp;amp;[Iron]&amp;lt;=_fered,"Yellow")&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Cr_Flag =
var _cryel=
SUMX(
    FILTER(ALL('UnitTypeLimits'),'UnitTypeLimits'[Unit Type]=EARLIER('Export'[UnitType])),[Cr_Yel])
var _crred=
SUMX(
    FILTER(ALL('UnitTypeLimits'),'UnitTypeLimits'[Unit Type]=EARLIER('Export'[UnitType])),[Cr_Red])
return
SWITCH(
    TRUE(),
    [Chrome]&amp;lt;_cryel,"NA",
    [Chrome]&amp;gt;=_crred,"Red",
    [Chrome]&amp;gt;=_cryel&amp;amp;&amp;amp;[Iron]&amp;lt;=_crred,"Yellow")&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 04:16:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3715871#M144630</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-22T04:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if value in home table is greater than Limit table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3717916#M144750</link>
      <description>&lt;P&gt;Works great - thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 18:13:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3717916#M144750</guid>
      <dc:creator>JKraft100</dc:creator>
      <dc:date>2024-02-22T18:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Check to see if value in home table is greater than Limit table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3717949#M144753</link>
      <description>&lt;P&gt;Hello, upon further testing there is one issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code works unless there is a [UnitType] that does not exist, if that is the case the result should be blank, but it shows a record.&amp;nbsp; as seen in the screen shot, there is no unit type of what is listed there but it is showing a flag?&amp;nbsp; The last column in this table is being pulled from the related table which shows nothing for a unit type.&amp;nbsp; The export table shows a unit type so my expected response would be, if there is no correlating unit type in my limits table, there should be no flag red or yel.&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 18:36:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Check-to-see-if-value-in-home-table-is-greater-than-Limit-table/m-p/3717949#M144753</guid>
      <dc:creator>JKraft100</dc:creator>
      <dc:date>2024-02-22T18:36:29Z</dc:date>
    </item>
  </channel>
</rss>

