<?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: Calling All Experts in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calling-All-Experts/m-p/4335821#M172167</link>
    <description>&lt;P&gt;Thanks for continuing to help&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="608865" data-lia-user-login="DataNinja777" class="lia-mention lia-mention-user"&gt;DataNinja777&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have now managed to get curves on the line and different years show different results using the updated measure below.&lt;/P&gt;&lt;P&gt;Average time =&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR FilteredAssessments = CALCULATETABLE(SELECTCOLUMNS(FILTER(Assessments,Assessments[Assessment Step - Name] = "Documents","AssessmentID",Assessments[Assessment Step ID],"EndDate",Assessments[Assessment Step - End]),USERELATIONSHIP(Assessments[Assessment Step - End],'Calendar'[Date]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR VirtualTable = CALCULATETABLE(ADDCOLUMNS(FilteredAssessments,"JobCreatedDate",LOOKUPVALUE(Jobs[Job Created Date],Jobs[JobID],LOOKUPVALUE(Facts[JobID],Facts[Assessment Step ID],[AssessmentID]))),USERELATIONSHIP(Jobs[Job Created Date],'Calendar'[Date]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;VAR AverageDays =&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;AVERAGEX(VirtualTable,DATEDIFF([JobCreatedDate],[EndDate],DAY))&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;AverageDays&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The graph/numbers/results are however still unresponsive to filters from outside.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would you suggest?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2024 01:17:32 GMT</pubDate>
    <dc:creator>Silvard</dc:creator>
    <dc:date>2024-12-19T01:17:32Z</dc:date>
    <item>
      <title>Calling All Experts</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calling-All-Experts/m-p/4335056#M172123</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;I’m having issues with the below measure.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;It’s showing a straight line in a line graph using year as x axis and the value doesn’t change when applying external filters. If I change to specific years, the value changes but the straight line remains.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;The assessment and jobs tables are connected to the facts table and the two date fields being used, share inactive relationships with the calendar date field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Ultimately, I just need the average time between two dates from different columns, but one that is responsive to time and other filters.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Unfortunately I’m unable to share any data and I greatly appreciate your assistance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;AverageTime = &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR FilteredAssessmentsTable = &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;SELECTCOLUMNS(FILTER(Assessments,Assessments[Assessment Step] = "Documents","AssessmentID",Assessments[Assessment Step ID],"EndDate",Assessments[Assessment Step - End])&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR VirtualTable = &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;ADDCOLUMNS(FilteredAssessments,"JobCreatedDate",LOOKUPVALUE(Jobs[Job Created Date],Jobs[JobID],LOOKUPVALUE(Facts[JobID],Facts[Assessment Step ID],[Assessment Step ID])))&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;VAR AverageDays =&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;AVERAGEX(CALCULATETABLE(VirtualTable,USERELATIONSHIP(Jobs[Job Created Date],'Calendar'[Date]),USERELATIONSHIP(Assessments[Assessment Step - End],'Calendar'[Date])),DATEDIFF([JobCreatedDate],[EndDate],DAY))&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;RETURN&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN&gt;AverageDays&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 12:27:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calling-All-Experts/m-p/4335056#M172123</guid>
      <dc:creator>Silvard</dc:creator>
      <dc:date>2024-12-18T12:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calling All Experts</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calling-All-Experts/m-p/4335115#M172124</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="803517" data-lia-user-login="Silvard" class="lia-mention lia-mention-user"&gt;Silvard&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The issue you're experiencing likely stems from the inactive relationships and the way your measure applies filters. Since you're using USERELATIONSHIP, it is important to ensure that all applied filters interact properly with the relationships and the measure.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The inactive relationships between Jobs and Calendar, as well as Assessments and Calendar, are handled correctly using USERELATIONSHIP in your measure. However, external filters need to propagate properly, which may not be happening effectively in the current configuration. Your FilteredAssessmentsTable must respond to slicers and filters as expected. If it does not, consider explicitly applying context using CALCULATETABLE.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The nested LOOKUPVALUE statements need to be carefully examined to ensure they are returning correct matches. Mismatched or missing data in these lookups could result in calculation errors or incomplete results. Furthermore, filter context from external slicers or visuals must propagate correctly to your measure. Wrapping your logic in CALCULATE can help achieve this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is a refined version of your AverageTime measure:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AverageTime =
VAR FilteredAssessmentsTable =
    SELECTCOLUMNS(
        FILTER(
            Assessments,
            Assessments[Assessment Step] = "Documents"
        ),
        "AssessmentID", Assessments[Assessment Step ID],
        "EndDate", Assessments[Assessment Step - End]
    )

VAR VirtualTable =
    ADDCOLUMNS(
        FilteredAssessmentsTable,
        "JobCreatedDate",
        LOOKUPVALUE(
            Jobs[Job Created Date],
            Jobs[JobID],
            LOOKUPVALUE(
                Facts[JobID],
                Facts[Assessment Step ID], [Assessment Step ID]
            )
        )
    )

VAR AverageDays =
    AVERAGEX(
        CALCULATETABLE(
            VirtualTable,
            USERELATIONSHIP(Jobs[Job Created Date], 'Calendar'[Date]),
            USERELATIONSHIP(Assessments[Assessment Step - End], 'Calendar'[Date])
        ),
        DATEDIFF([JobCreatedDate], [EndDate], DAY)
    )

RETURN
    AverageDays
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;To troubleshoot, test the virtual table by creating a measure to count rows or inspect it using SUMMARIZE. This will help ensure that the virtual table is being filtered correctly. Additionally, break down the measure into smaller parts and test them individually to identify where the filter context might not be applied. Review the relationships in your model to confirm that the inactive relationships are properly configured and match the fields used in the USERELATIONSHIP function.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If the measure still produces a straight line, it may indicate missing or invalid data in the JobCreatedDate or EndDate fields. Explicitly applying filters with CALCULATE can simulate slicer interactions and verify the measure's responsiveness. Finally, ensure that the Calendar table is correctly linked and not inadvertently filtered by inactive relationships. If possible, replacing LOOKUPVALUE with joins in Power Query may simplify debugging and improve performance. If the issue persists, inspect the data more thoroughly to ensure it aligns with the intended logic.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 13:07:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calling-All-Experts/m-p/4335115#M172124</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2024-12-18T13:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calling All Experts</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calling-All-Experts/m-p/4335821#M172167</link>
      <description>&lt;P&gt;Thanks for continuing to help&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="608865" data-lia-user-login="DataNinja777" class="lia-mention lia-mention-user"&gt;DataNinja777&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have now managed to get curves on the line and different years show different results using the updated measure below.&lt;/P&gt;&lt;P&gt;Average time =&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR FilteredAssessments = CALCULATETABLE(SELECTCOLUMNS(FILTER(Assessments,Assessments[Assessment Step - Name] = "Documents","AssessmentID",Assessments[Assessment Step ID],"EndDate",Assessments[Assessment Step - End]),USERELATIONSHIP(Assessments[Assessment Step - End],'Calendar'[Date]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR VirtualTable = CALCULATETABLE(ADDCOLUMNS(FilteredAssessments,"JobCreatedDate",LOOKUPVALUE(Jobs[Job Created Date],Jobs[JobID],LOOKUPVALUE(Facts[JobID],Facts[Assessment Step ID],[AssessmentID]))),USERELATIONSHIP(Jobs[Job Created Date],'Calendar'[Date]))&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;VAR AverageDays =&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;AVERAGEX(VirtualTable,DATEDIFF([JobCreatedDate],[EndDate],DAY))&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;AverageDays&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The graph/numbers/results are however still unresponsive to filters from outside.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would you suggest?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 01:17:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calling-All-Experts/m-p/4335821#M172167</guid>
      <dc:creator>Silvard</dc:creator>
      <dc:date>2024-12-19T01:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calling All Experts</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calling-All-Experts/m-p/4336033#M172174</link>
      <description>&lt;P&gt;I managed to solve the issue by using the below. Essentially, using treatas was the missing piece.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Average time = &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR FilteredAssessments = FILTER(Assessments,Assessments[Assessment Step - Name] = "Documents")&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR VirtualTable = &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;SUMMARIZE(FilteredAssessments,Assessments[Assessment Step ID],Assessments[Assessment Step - End],"JobCreatedDate",CALCULATE(TRUNC(MAX(Jobs[Job Created Date])),Jobs[Job Created Date] &amp;lt;&amp;gt; BLANK(),TREATAS(VALUES(Facts[JobID]),Jobs[JobID]),TREATAS(VALUES(Assessments[Assessment Step ID]),Facts[Assessment Step ID]),USERELATIONSHIP(Jobs[Job Created Date],'Calendar'[Date])))&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;AVERAGEX(VirtualTable,DATEDIFF([JobCreatedDate],TRUNC([Assessment Step - End]),DAY))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 04:07:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calling-All-Experts/m-p/4336033#M172174</guid>
      <dc:creator>Silvard</dc:creator>
      <dc:date>2024-12-19T04:07:56Z</dc:date>
    </item>
  </channel>
</rss>

