<?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: Measure for two bridged fact tables with filters from one fact table based on other fact table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-two-bridged-fact-tables-with-filters-from-one-fact/m-p/3703679#M144062</link>
    <description>&lt;P&gt;Hi, thanks for this! I understand the approach trying to be used here, but the measure won't work without there being a single value for the variables defined, I tried using SELECTEDVALUE() around the 3 variables but that doesn't seem to do the trick - is there another function I can try to get it evaluate each enquiry row in turn? Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 16 Feb 2024 10:18:31 GMT</pubDate>
    <dc:creator>ekulchewie</dc:creator>
    <dc:date>2024-02-16T10:18:31Z</dc:date>
    <item>
      <title>Measure for two bridged fact tables with filters from one fact table based on other fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-two-bridged-fact-tables-with-filters-from-one-fact/m-p/3703571#M144054</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I have the following model which involves 2 fact tables and 2 dimension tables:&lt;BR /&gt;&lt;BR /&gt;Fact Table A = table of enquiries with a date of enquiry and other related dates about the enquiry e.g. Date enquiry dealt with, date of next enquiry. Many enquiries relate to a single customer, who has one phone number. (named 'SQL_Enquiries')&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date of Enquiry&lt;/TD&gt;&lt;TD&gt;Phone Number&lt;/TD&gt;&lt;TD&gt;Min call date window&lt;/TD&gt;&lt;TD&gt;Max call date window&lt;/TD&gt;&lt;TD&gt;Contact Number&lt;/TD&gt;&lt;TD&gt;Enquiry Number&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15/01/2024&lt;/TD&gt;&lt;TD&gt;779124623&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;18/01/2024&lt;/TD&gt;&lt;TD&gt;123456&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;16/01/2024&lt;/TD&gt;&lt;TD&gt;779124623&lt;/TD&gt;&lt;TD&gt;18/01/2024&lt;/TD&gt;&lt;TD&gt;24/01/2024&lt;/TD&gt;&lt;TD&gt;123456&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;17/01/2024&lt;/TD&gt;&lt;TD&gt;776634661&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;25/01/2024&lt;/TD&gt;&lt;TD&gt;818654&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;Fact Table B = table of phone calls which has a column for date of call and caller phone number (named 'Compiled Call Log')&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Call Time&lt;/TD&gt;&lt;TD&gt;Phone Number&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;14/01/2024&amp;nbsp; 15:39:00&lt;/TD&gt;&lt;TD&gt;779124623&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;15/01/2024&amp;nbsp; 08:30:00&lt;/TD&gt;&lt;TD&gt;779124623&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/01/2024&amp;nbsp; 10:31:00&lt;/TD&gt;&lt;TD&gt;776634661&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;Dim Table A = date table which is linked via 2 1:many active relationships to A &amp;amp; B’s date of enquiry/call&lt;BR /&gt;&lt;BR /&gt;Dim Table B = list of phone numbers also linked via 2 1:many active relationships to A &amp;amp; B via the phone number columns&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Phone Number&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;779124623&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;776634661&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;I have a couple of calculated columns in table A which evaluate the maximum call date and the minimum call date to establish a range of call dates that ‘could’ relate to a phone call to use as a filter.&lt;BR /&gt;&lt;BR /&gt;I am looking to create a measure to evaluate the number of phone calls made related to each enquiry (via the phone number) filtered by whether the call date falls into the maximum / minimum range of the enquiry date.&lt;BR /&gt;&lt;BR /&gt;I’ve managed to do this as a calculated column in table A with the following DAX, but I cannot get this to work as a measure - any help appreciated please! &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;Note - I could join fact table A and fact table B to go with a proper star schema but I don’t wish to filter all existing measures for enquiries based on whether they are an enquiry or a call.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 09:19:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-two-bridged-fact-tables-with-filters-from-one-fact/m-p/3703571#M144054</guid>
      <dc:creator>ekulchewie</dc:creator>
      <dc:date>2024-02-16T09:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for two bridged fact tables with filters from one fact table based on other fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-two-bridged-fact-tables-with-filters-from-one-fact/m-p/3703667#M144059</link>
      <description>&lt;P&gt;&lt;SPAN&gt;To create a measure that evaluates the number of phone calls made related to each enquiry (via the phone number) filtered by whether the call date falls into the maximum/minimum range of the enquiry date, you can use DAX functions to calculate this dynamically. Here's how you can approach it:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Calls Related to Enquiries =&lt;BR /&gt;VAR EnquiryPhone = 'SQL_Enquiries'[Phone Number]&lt;BR /&gt;VAR MinCallDate = 'SQL_Enquiries'[Min call date window]&lt;BR /&gt;VAR MaxCallDate = 'SQL_Enquiries'[Max call date window]&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;COUNTROWS('Compiled Call Log'),&lt;BR /&gt;'Compiled Call Log'[Phone Number] = EnquiryPhone,&lt;BR /&gt;'Compiled Call Log'[Call Time] &amp;gt;= MinCallDate,&lt;BR /&gt;'Compiled Call Log'[Call Time] &amp;lt;= MaxCallDate&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Explanation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;We first define variables to store the phone number, minimum call date, and maximum call date for each enquiry.&lt;/LI&gt;&lt;LI&gt;Then, we use the CALCULATE function to apply filters to the 'Compiled Call Log' table:&lt;UL&gt;&lt;LI&gt;Filter by 'Phone Number' to match the enquiry phone number.&lt;/LI&gt;&lt;LI&gt;Filter by 'Call Time' to make sure it falls within the range defined by the minimum and maximum call dates for each enquiry.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Finally, we count the rows in the 'Compiled Call Log' table that meet all the specified conditions.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You can create this measure in your model and use it in your reports to get the count of phone calls related to each enquiry based on the specified date range.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 10:11:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-two-bridged-fact-tables-with-filters-from-one-fact/m-p/3703667#M144059</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-02-16T10:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for two bridged fact tables with filters from one fact table based on other fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-two-bridged-fact-tables-with-filters-from-one-fact/m-p/3703679#M144062</link>
      <description>&lt;P&gt;Hi, thanks for this! I understand the approach trying to be used here, but the measure won't work without there being a single value for the variables defined, I tried using SELECTEDVALUE() around the 3 variables but that doesn't seem to do the trick - is there another function I can try to get it evaluate each enquiry row in turn? Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 10:18:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-two-bridged-fact-tables-with-filters-from-one-fact/m-p/3703679#M144062</guid>
      <dc:creator>ekulchewie</dc:creator>
      <dc:date>2024-02-16T10:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for two bridged fact tables with filters from one fact table based on other fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-two-bridged-fact-tables-with-filters-from-one-fact/m-p/3716700#M144672</link>
      <description>&lt;P&gt;&lt;SPAN&gt;To handle scenarios where there isn't a single value for the variables due to the iteration over rows in 'SQL_Enquiries', you can use the SUMX function along with FILTER to iterate over each row of 'SQL_Enquiries'. Within the iteration, you can calculate the count of related phone calls for each enquiry. Here's how you can modify the measure:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Phone Calls Related to Enquiries =&lt;BR /&gt;SUMX(&lt;BR /&gt;'SQL_Enquiries',&lt;BR /&gt;VAR CurrentEnquiry = 'SQL_Enquiries'[Enquiry Number]&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;COUNTROWS('Compiled Call Log'),&lt;BR /&gt;FILTER(&lt;BR /&gt;'Compiled Call Log',&lt;BR /&gt;'Compiled Call Log'[Phone Number] = EARLIER('SQL_Enquiries'[Phone Number]) &amp;amp;&amp;amp;&lt;BR /&gt;'Compiled Call Log'[Call Time] &amp;gt;= EARLIER('SQL_Enquiries'[Min call date window]) &amp;amp;&amp;amp;&lt;BR /&gt;'Compiled Call Log'[Call Time] &amp;lt;= EARLIER('SQL_Enquiries'[Max call date window])&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Explanation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SUMX iterates over each row of 'SQL_Enquiries'.&lt;/LI&gt;&lt;LI&gt;EARLIER function is used to refer to the values of columns from the current row context created by SUMX.&lt;/LI&gt;&lt;LI&gt;Within the CALCULATE function, FILTER is applied to filter the 'Compiled Call Log' based on the current row's Phone Number and date range (Min call date window and Max call date window).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This modification should allow the measure to correctly evaluate the count of phone calls related to each enquiry, considering the date range conditions for each row in 'SQL_Enquiries'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If I answered your question, please mark my post as solution, Appreciate your Kudos.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 09:45:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-two-bridged-fact-tables-with-filters-from-one-fact/m-p/3716700#M144672</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-02-22T09:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Measure for two bridged fact tables with filters from one fact table based on other fact table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-two-bridged-fact-tables-with-filters-from-one-fact/m-p/3716763#M144679</link>
      <description>&lt;P&gt;Amazing - thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I correct in assuming the variable declared is for improved readability to understand the SUMX is iterating for each record?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 10:00:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Measure-for-two-bridged-fact-tables-with-filters-from-one-fact/m-p/3716763#M144679</guid>
      <dc:creator>ekulchewie</dc:creator>
      <dc:date>2024-02-22T10:00:19Z</dc:date>
    </item>
  </channel>
</rss>

