<?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: For each user, unique latest date occurence of any of a subset items -linked table,multiple criteria in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-user-unique-latest-date-occurence-of-any-of-a-subset/m-p/905312#M8481</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="198979" data-lia-user-login="patrick_d" class="lia-mention lia-mention-user"&gt;patrick_d&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can set up the model to show more than one course in a single day for staff member:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can have more than 1 relevant course in a single day, you can create measures as a filter:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Countrows training courses = 
COUNTROWS(CALCULATETABLE(VALUES(TrainingTable[Training Course]); 
    FILTER('Calendar'; 
    'Calendar'[Date] = [Last Relevant date by Staff member])))&lt;/LI-CODE&gt;&lt;P&gt;And use this in the filter pane;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately this method will not allow you to see those without relevant courses- but you can show them in a seperate table using:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;No Relevant Courses = 
VAR Rel = CALCULATETABLE(VALUES(StaffTable[staff_name]); 
    FILTER(StaffTable; 
    [Countrows training courses] &amp;gt;= 1))
VAR staff = VALUES(StaffTable[staff_name])
Return
COUNTROWS(EXCEPT(staff; Rel))&lt;/LI-CODE&gt;&lt;P&gt;And again, using this measure in the filter pane:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2020 14:28:13 GMT</pubDate>
    <dc:creator>PaulDBrown</dc:creator>
    <dc:date>2020-01-20T14:28:13Z</dc:date>
    <item>
      <title>For each user, unique latest date occurence of any of a subset items -linked table,multiple criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-user-unique-latest-date-occurence-of-any-of-a-subset/m-p/899566#M8191</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I am new to PowerBI and despite trying out various approaches based on other threads (eg. &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="143212" data-lia-user-login="v-diye-msft" class="lia-mention lia-mention-user"&gt;v-diye-msft&lt;/a&gt; , &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24542" data-lia-user-login="PaulDBrown" class="lia-mention lia-mention-user"&gt;PaulDBrown&lt;/a&gt;) , I have not managed to find a working solution to the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to identify staff who need to attend refresher training based on knowing the most recent date they have completed relevant training.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Relevant training is a subset of possible training ie. only 3 modules qualify - let's call them:&lt;BR /&gt;training_A_relevant&lt;BR /&gt;training_B_relevant&lt;BR /&gt;training_C_relevant&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the logic I am looking for is:&lt;BR /&gt;For each staff_name, what is the most recent date that any RELEVANT training session has been attended. (I can then use DATEDIFF to find the number of days between TODAY and that date, to identify who needs refresher training and show compliance dashboard).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample data is as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;StaffTable:&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;staff_name&lt;/EM&gt;&lt;BR /&gt;Lee&lt;BR /&gt;Jane&lt;BR /&gt;Chen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TrainingTable:&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;staff_name&lt;/EM&gt;&amp;nbsp;&lt;EM&gt; training_module&lt;/EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;training_date&lt;/EM&gt;&lt;BR /&gt;Lee&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; training_A_relevant&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10 Oct 2018&lt;BR /&gt;Lee&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; training_B_relevant&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30 Apr 2018&lt;BR /&gt;Lee&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; training_D_not_relevant&amp;nbsp;&amp;nbsp; 05 Jul 2019&lt;BR /&gt;Jane&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; training_C_relevant&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11 Feb 2019&lt;BR /&gt;Jane&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; training_D_not_relevant&amp;nbsp; 11 Nov 2019&lt;BR /&gt;Jane &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; training_A_relevant&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10 Oct 2018&lt;BR /&gt;Chen&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; training_D_not_relevant&amp;nbsp; 10 Oct 2018&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result I am after is to add two new columns to the StaffTable to provide:&lt;BR /&gt;1. &lt;EM&gt;LatestRelevantTrainingDate &lt;/EM&gt;for each staff_name showing the most recent date any relevant training occured (this is the most important criteria) and&lt;BR /&gt;2. &lt;EM&gt;training_module&lt;/EM&gt;&amp;nbsp; the name of the relevant training module done at that &lt;EM&gt;LatestRelevantTrainingDate&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So based on the sample data above, the result I am after is the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;StaffTable: (Updated)&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;staff_name&lt;/EM&gt;&amp;nbsp;&amp;nbsp; &lt;EM&gt;LatestRelevantTrainingDate&lt;/EM&gt;&amp;nbsp;&amp;nbsp; &lt;EM&gt;training_module&lt;/EM&gt;&lt;BR /&gt;Lee&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10 Oct 2018&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; training_A_relevant&lt;BR /&gt;Jane&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11 Feb 2019&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; training_C_relevant&lt;BR /&gt;Chen&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 14:22:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-user-unique-latest-date-occurence-of-any-of-a-subset/m-p/899566#M8191</guid>
      <dc:creator>patrick_d</dc:creator>
      <dc:date>2020-01-14T14:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: For each user, unique latest date occurence of any of a subset items -linked table,multiple criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-user-unique-latest-date-occurence-of-any-of-a-subset/m-p/899820#M8203</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;This is a calculated staff table, you will probably want to create a real one and load it&lt;BR /&gt;The staff table has a relationship to the training table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;and i added a calculated column to the training table to detect relavant trainings, you probably would want to have a "training module" table, with a true/false flag to mark the relevant trainings as detecting them by parsing strings is kind of error prone.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;since you said you wanted to end up with a table, rather than a report&lt;/P&gt;&lt;P&gt;I added the columns you asked for to the staff table.&lt;BR /&gt;this is the code for the date column:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Date = calculate(max(training[training_date]),training[Relevant])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;this code uses the relationship between the staff table and the training table. That's why it doesn't have to specify that it wants the max for a particular person, the relationship is already filtering the training table for the trainings for the person in the row the code is executing in.&lt;BR /&gt;Since the "relevant" field has true false values, it can be used as a filter in the calculate statement, to just consider the trainings where it is true.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;A href="https://personalpowerbitrainer.com/" target="_blank"&gt;I'm a personal Power Bi Trainer&lt;/A&gt;&lt;EM&gt; I learn something every time I answer a question&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;The Golden Rules for Power BI&lt;/EM&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Use a Calendar table. A custom Date tables is preferable to using the automatic date/time handling capabilities of Power BI. &lt;A href="https://www.youtube.com/watch?v=FxiAYGbCfAQ" target="_blank"&gt;https://www.youtube.com/watch?v=FxiAYGbCfAQ&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Build your data model as a Star Schema. Creating a star schema in Power BI is the best practice to improve performance and more importantly, to ensure accurate results! &lt;A href="https://www.youtube.com/watch?v=1Kilya6aUQw" target="_blank"&gt;https://www.youtube.com/watch?v=1Kilya6aUQw&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;Use a small set up sample data when developing. When building your measures and calculated columns always use a small amount of sample data so that it will be easier to confirm that you are getting the right numbers.&lt;/LI&gt;&lt;LI&gt;Store all your intermediate calculations in VARs when you’re writing measures. You can return these intermediate VARs instead of your final result &amp;nbsp;to check on your steps along the way.&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Jan 2020 18:13:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-user-unique-latest-date-occurence-of-any-of-a-subset/m-p/899820#M8203</guid>
      <dc:creator>kentyler</dc:creator>
      <dc:date>2020-01-14T18:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: For each user, unique latest date occurence of any of a subset items -linked table,multiple criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-user-unique-latest-date-occurence-of-any-of-a-subset/m-p/899895#M8210</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="198979" data-lia-user-login="patrick_d" class="lia-mention lia-mention-user"&gt;patrick_d&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first thing I have done is create lookup tables for the main fields; date, courses and staff. I also included a column in the main fact table which identifies whether a course is defined as "relevant" or "not relevant" with:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Relevance = IF(CONTAINSSTRING(TrainingTable[training_module]; "not_relevant"); "Not Relevant"; "Relevant")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The model looks like this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then create the measures:&lt;/P&gt;&lt;P&gt;1) to calculate the last date for relevant courses per staff member:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Last Date by Relevant Course = CALCULATE(MAX(TrainingTable[training_date]); 
ALLEXCEPT(StaffTable; StaffTable[staff_name]); 
FILTER(TrainingTable;
TrainingTable[Relevance] = "Relevant"))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) to calculate the last date for all dates and courses (by Staff member):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Last Relevant date by Staff member = CALCULATE([Last Date by Relevant Course]; 
    ALLEXCEPT(StaffTable; StaffTable[staff_name]); 
        ALL('Training Code'); ALL('Calendar'[Date]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) Next calculate the relavant course on this last date:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Relevant Training Course = 
CALCULATE(MAX('TrainingTable'[Training Course]); 
    FILTER('Calendar';
        'Calendar'[Date] = [Last Relevant date by Staff member]))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4) If you want to include Staff Members who have no relevant courses ("Chen" in your example), use these two measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Last Rel. Training Course (For Table) = IF(
    ISBLANK([Last Relevant date by Staff member]); 
    "Null"; 
        [Relevant Training Course])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Last Rel. Training Date (For Table) = IF(
    ISBLANK([Last Relevant date by Staff member]); 
        "Null"; 
            [Last Relevant date by Staff member])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And with all this, you get the following:&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 is the PBIX file for your reference:&lt;BR /&gt;&lt;A href="https://1drv.ms/u/s!AhGKDZz6e4Het2VfNVJBWgSmtdGo?e=KHdo7R" target="_self"&gt;Staff Training&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 08:58:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-user-unique-latest-date-occurence-of-any-of-a-subset/m-p/899895#M8210</guid>
      <dc:creator>PaulDBrown</dc:creator>
      <dc:date>2020-01-15T08:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: For each user, unique latest date occurence of any of a subset items -linked table,multiple criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-user-unique-latest-date-occurence-of-any-of-a-subset/m-p/904671#M8437</link>
      <description>&lt;P&gt;Many thanks for your prompt replies Ken &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="114168" data-lia-user-login="kentyler" class="lia-mention lia-mention-user"&gt;kentyler&lt;/a&gt; and&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24542" data-lia-user-login="PaulDBrown" class="lia-mention lia-mention-user"&gt;PaulDBrown&lt;/a&gt;&amp;nbsp; - much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note that the data/tables provided were a simplification to highlight what I was trying to solve.&lt;/P&gt;&lt;P&gt;The actual data set is based on a Dynamics CRM connection,so the Staff table is in fact a contacts table with a unique contactid and countless columns; there is a separate training_table with module_ID and name where I have created the equivalent of a "Relevant" column, a training_sessions table that has the training date with the link back to the module_ID in the training_table and link back to the contactid in the contacts table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just a couple of notes before sending kudos your way in case it helps others:&lt;BR /&gt;- Ken, I had previously used the logic you provided but was not getting the expected unique result for Last Relevant Date. I realised this was because the automatic relationships created by PowerBI when I imported the data from Dynamics was not a uni directional One-&amp;gt;Many and so adjusting this gave the desired result for Last Relevant Date.&lt;BR /&gt;- On the other hand, just using that formula Ken does not give me a single entry per staff showing the latest relevant module that matches that last date. Instead for every matched staff member the table lists all the other training done by that staff member as well.&lt;BR /&gt;- Paul, your more comprehensive approach looks like it might address this once I have had a chance to do the necessary changes. Note though that it is common for staff to take part in two training sessions on the same date.&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2020 06:33:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-user-unique-latest-date-occurence-of-any-of-a-subset/m-p/904671#M8437</guid>
      <dc:creator>patrick_d</dc:creator>
      <dc:date>2020-01-20T06:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: For each user, unique latest date occurence of any of a subset items -linked table,multiple criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-user-unique-latest-date-occurence-of-any-of-a-subset/m-p/905312#M8481</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="198979" data-lia-user-login="patrick_d" class="lia-mention lia-mention-user"&gt;patrick_d&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can set up the model to show more than one course in a single day for staff member:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can have more than 1 relevant course in a single day, you can create measures as a filter:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Countrows training courses = 
COUNTROWS(CALCULATETABLE(VALUES(TrainingTable[Training Course]); 
    FILTER('Calendar'; 
    'Calendar'[Date] = [Last Relevant date by Staff member])))&lt;/LI-CODE&gt;&lt;P&gt;And use this in the filter pane;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately this method will not allow you to see those without relevant courses- but you can show them in a seperate table using:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;No Relevant Courses = 
VAR Rel = CALCULATETABLE(VALUES(StaffTable[staff_name]); 
    FILTER(StaffTable; 
    [Countrows training courses] &amp;gt;= 1))
VAR staff = VALUES(StaffTable[staff_name])
Return
COUNTROWS(EXCEPT(staff; Rel))&lt;/LI-CODE&gt;&lt;P&gt;And again, using this measure in the filter pane:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2020 14:28:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/For-each-user-unique-latest-date-occurence-of-any-of-a-subset/m-p/905312#M8481</guid>
      <dc:creator>PaulDBrown</dc:creator>
      <dc:date>2020-01-20T14:28:13Z</dc:date>
    </item>
  </channel>
</rss>

