<?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: Calculation involving 3 fact tables, conditions and visualization in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4337942#M172246</link>
    <description>&lt;P&gt;anyone have an idea on how to get the numbers?&lt;/P&gt;</description>
    <pubDate>Fri, 20 Dec 2024 03:45:17 GMT</pubDate>
    <dc:creator>SrMatto</dc:creator>
    <dc:date>2024-12-20T03:45:17Z</dc:date>
    <item>
      <title>Calculation involving 3 fact tables, conditions and visualization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4331769#M171970</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I am trying to achieve the following calculation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count all the programs that have been completed, considering the following conditions:&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;It should consider all the persons enrolled on that specific IdDate (defined&amp;nbsp;in the slicers). i.e VALUES(DimDate[IdDate])&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;The completion should be on or after that IdDate. i.e FactCompletion: IdDate&amp;gt;=Min(FactEnrollment[IdDate]). FactEnrollment[Degree of Completion]="Complete"&lt;/P&gt;&lt;P&gt;3.&amp;nbsp;The result should be presented in a table that has the Group and Category in which the Person was first considered, &lt;STRONG&gt;NOT when&lt;/STRONG&gt; it was Completed. Also, &lt;STRONG&gt;a person can be in more than one Group during a IdDate&lt;/STRONG&gt;. The info is in FactGroup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data model is:&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;As an example, with these slicers:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;These are the Persons enrolled in 20181 and 20231 with their corresponding Groups:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;From this list, the ones that have Completed a Program are:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus, it should lead to this excpected result:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note that a person might be counted more than once depending on the Rollup.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added a table in the PIBX,&amp;nbsp;the fields are what I wish to have but the values are wrong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.dropbox.com/scl/fi/w38k7eso52tync5atl2jq/3-facts-calculation.pbix?rlkey=ztr9w6g4c3vhn5i7njqyy2kq0&amp;amp;st=4hr0drm3&amp;amp;dl=0" target="_self"&gt;link to pbix&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 00:04:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4331769#M171970</guid>
      <dc:creator>SrMatto</dc:creator>
      <dc:date>2024-12-17T00:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation involving 3 fact tables, conditions and visualization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4331903#M171976</link>
      <description>&lt;P&gt;Here is how I would refactor the data model. Avoid bridge tables, avoid joining fact tables, avoid bidirectionals.&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;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 02:00:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4331903#M171976</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-12-17T02:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation involving 3 fact tables, conditions and visualization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4332053#M171986</link>
      <description>&lt;P&gt;thank you for your reply, but it's nowhere near the expected result.&amp;nbsp;&lt;BR /&gt;also, it doesn't solve the requirement of cross filtering 3 fact tables. (Or maybe i misunderstood your reply?)&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 03:42:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4332053#M171986</guid>
      <dc:creator>SrMatto</dc:creator>
      <dc:date>2024-12-17T03:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation involving 3 fact tables, conditions and visualization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4337942#M172246</link>
      <description>&lt;P&gt;anyone have an idea on how to get the numbers?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 03:45:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4337942#M172246</guid>
      <dc:creator>SrMatto</dc:creator>
      <dc:date>2024-12-20T03:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation involving 3 fact tables, conditions and visualization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4342817#M172439</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="834634" data-lia-user-login="SrMatto" class="lia-mention lia-mention-user"&gt;SrMatto&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I updated your sample pbix file(see &lt;EM&gt;&lt;STRONG&gt;the attachment&lt;/STRONG&gt;&lt;/EM&gt;), please check if that is what you want.&lt;/P&gt;
&lt;P&gt;1. &lt;STRONG&gt;Delete&lt;/STRONG&gt; the relationship between the table 'Bridge' and 'FactCompletion'&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Create two measures as below to get the count of person ids which fulfill the conditions&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
VAR _selyear =
    ALLSELECTED ( 'DimDate'[year] )
VAR _semester =
    ALLSELECTED ( 'DimDate'[semester] )
VAR _category =
    ALLSELECTED ( 'DimGroup'[Category] )
VAR _program =
    SELECTEDVALUE ( 'Table'[Program] )
VAR _personids =
    CALCULATETABLE (
        VALUES ( 'Bridge'[Person ID] ),
        FILTER (
            ALLSELECTED ( 'Bridge' ),
            'Bridge'[IdDate] IN ALLSELECTED ( 'DimDate'[IdDate] )
        )
    )
VAR _count =
    CALCULATE (
        DISTINCTCOUNT ( 'FactCompletion'[Person ID] ),
        FILTER (
            'FactCompletion',
            'FactCompletion'[Person ID]
                IN _personids
                    &amp;amp;&amp;amp; 'FactCompletion'[Degree of Completion] = "Complete"
                    &amp;amp;&amp;amp; 'FactCompletion'[IdDate] &amp;gt; MIN ( 'DimDate'[IdDate] )
                    &amp;amp;&amp;amp; 'FactCompletion'[IdDate] &amp;gt; MIN ( 'DimDate'[IdDate] )
        )
    )
RETURN
    _count&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Corrected Count =
SUMX (
    VALUES ( 'DimGroup'[Category] ),
    SUMX ( VALUES ( 'Table'[Program] ), [Measure] )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 25 Dec 2024 08:46:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4342817#M172439</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-25T08:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation involving 3 fact tables, conditions and visualization</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4343025#M172446</link>
      <description>&lt;P&gt;Amazing.&lt;BR /&gt;Perfect timing for a christams gift!&lt;BR /&gt;Thank you so very much&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Dec 2024 22:44:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-involving-3-fact-tables-conditions-and-visualization/m-p/4343025#M172446</guid>
      <dc:creator>SrMatto</dc:creator>
      <dc:date>2024-12-25T22:44:46Z</dc:date>
    </item>
  </channel>
</rss>

