<?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 Return values for one column only if they match criteria from another column in another table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-one-column-only-if-they-match-criteria-from/m-p/2163553#M50045</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'd like to know which lots ran on the day they were supposed to (tables shown below), and I'm not sure how to go about it. I think I need to create another table.... I imagine the table would have 3 columns: Lot Number (ONLY those lots that were run on the date they were scheduled), Production Start Date (the date the lot actually ran), and the Lot Type. The biggest issue I'm having is the measure needed for the Lot Number column to return only the relevant values. Also, multiple lots run on the same day&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The end goal is to create card visualizations counting the number of lots based on type. "count of type A lots that actually ran on the date they were supposed to" "count of type B lots that actually ran on the date they were supposed to", etc. So I feel like with the table explained above I could easily use count measures to create these cards?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Schedule data (when the lot was scheduled to run)&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;TABLE border="1" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Schedule date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Lot number&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Lot Type&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;10252021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12345&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;10252021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;23456&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Production data (when the lot actually ran)&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;TABLE border="1" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Production start date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Lot number&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Lot type&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;10252021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12345&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;10262021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;23456&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&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;If it helps, I am using this measure to count the lots that were run on the day they were scheduled. Now I need to know which lots were counted in this measure (Thanks to &lt;SPAN&gt;VahidDM&amp;nbsp;&lt;/SPAN&gt;on my other post):&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Actual # of Lots = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_A&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ADDCOLUMNS&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;production_data&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Sche-Date"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LOOKUPVALUE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;schedule_data[schedule_date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;schedule_data[lot_no]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;production_data[lot_no]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[production_start_date]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;[Sche-Date]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;_A&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 29 Oct 2021 16:03:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-10-29T16:03:58Z</dc:date>
    <item>
      <title>Return values for one column only if they match criteria from another column in another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-one-column-only-if-they-match-criteria-from/m-p/2163553#M50045</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'd like to know which lots ran on the day they were supposed to (tables shown below), and I'm not sure how to go about it. I think I need to create another table.... I imagine the table would have 3 columns: Lot Number (ONLY those lots that were run on the date they were scheduled), Production Start Date (the date the lot actually ran), and the Lot Type. The biggest issue I'm having is the measure needed for the Lot Number column to return only the relevant values. Also, multiple lots run on the same day&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The end goal is to create card visualizations counting the number of lots based on type. "count of type A lots that actually ran on the date they were supposed to" "count of type B lots that actually ran on the date they were supposed to", etc. So I feel like with the table explained above I could easily use count measures to create these cards?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Schedule data (when the lot was scheduled to run)&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;TABLE border="1" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Schedule date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Lot number&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Lot Type&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;10252021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12345&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;10252021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;23456&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Production data (when the lot actually ran)&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;TABLE border="1" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Production start date&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Lot number&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Lot type&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;10252021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;12345&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;10262021&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;23456&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&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;If it helps, I am using this measure to count the lots that were run on the day they were scheduled. Now I need to know which lots were counted in this measure (Thanks to &lt;SPAN&gt;VahidDM&amp;nbsp;&lt;/SPAN&gt;on my other post):&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Actual # of Lots = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;_A&lt;/SPAN&gt;&lt;SPAN&gt; =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ADDCOLUMNS&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;production_data&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"Sche-Date"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;LOOKUPVALUE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;schedule_data[schedule_date]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;schedule_data[lot_no]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;production_data[lot_no]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[production_start_date]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;[Sche-Date]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;_A&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 29 Oct 2021 16:03:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-one-column-only-if-they-match-criteria-from/m-p/2163553#M50045</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-29T16:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: Return values for one column only if they match criteria from another column in another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-one-column-only-if-they-match-criteria-from/m-p/2163787#M50062</link>
      <description>&lt;P&gt;It sounds like you want to add the Lot type as another filter condition.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Type A lots run on proper day =
VAR _A =
    FILTER (
        ADDCOLUMNS (
            production_data,
            "Sche-Date",
                LOOKUPVALUE (
                    schedule_data[schedule_date],
                    schedule_data[lot_no], production_data[lot_no]
                )
        ),
        [production_start_date] = [Sche-Date]
            &amp;amp;&amp;amp; [Lot type] = "A"
    )
RETURN
    COUNTROWS ( _A )&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 29 Oct 2021 20:20:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-one-column-only-if-they-match-criteria-from/m-p/2163787#M50062</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-10-29T20:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Return values for one column only if they match criteria from another column in another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-one-column-only-if-they-match-criteria-from/m-p/2164919#M50133</link>
      <description>&lt;P&gt;Thank you for your reply! I don't really need to count them anymore, I really do think I need a table in order to manipulate the data in the ways needed for the rest of my dashboard. This is helpful for the cards though!&lt;/P&gt;</description>
      <pubDate>Sun, 31 Oct 2021 15:49:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-one-column-only-if-they-match-criteria-from/m-p/2164919#M50133</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-31T15:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Return values for one column only if they match criteria from another column in another table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-one-column-only-if-they-match-criteria-from/m-p/2170232#M50378</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your DAX formula and your sample data, I can’t find the data field [schedule_date] in your sample data and I have no idea how to create the sample test data to achieve your needs. Would you like to post some sample data in table form or pbix file(without sensitive data) and your expected result(like the chart you want to get and the correct measure value based on your sample data)?&lt;/P&gt;
&lt;P&gt;Thanks very much!&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, 03 Nov 2021 09:25:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Return-values-for-one-column-only-if-they-match-criteria-from/m-p/2170232#M50378</guid>
      <dc:creator>v-robertq-msft</dc:creator>
      <dc:date>2021-11-03T09:25:24Z</dc:date>
    </item>
  </channel>
</rss>

