<?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 Get Sum of a measure in row context in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Sum-of-a-measure-in-row-context/m-p/2535999#M71266</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table of Assignments and a table Employees.&lt;/P&gt;&lt;P&gt;I want to get Howmany days in the filter are within every assignment start and end date ... to get the employee booking hours within the selected month and year only&lt;/P&gt;&lt;P&gt;For Example I selected Employee= Keerthi and month=March 2022 ... you can see that the column&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;**Demand_Days_of_task_in_period&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;will only count the days of this assignment that is within my date selection , so only march days are counted while feb and may are not.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The measure formula&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;** Demand_Days_of_task_in_period = CALCULATE(COUNTROWS('Date'),FILTER('Date','Date'[Date]&amp;gt;=MIN(Assignments[AssignmentStartDate])&amp;amp;&amp;amp;'Date'[Date]&amp;lt;=MIN(Assignments[AssignmentFinishDate])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&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;STRONG&gt;The requirement:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I want to access this measure out of row context, meaning that when I add it to a card it will sum all the rows values (6+1+1+1+2+2+2+2+1)= 18&amp;nbsp;&lt;/STRONG&gt;.. but as you can see the card on the top right which is with the same measure is giving me blank, it will only give me a value when I select a specific row ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I searched for it but found most ways are through creating a calculated column, while the measure here will depend on the user selection of the date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 May 2022 11:29:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-05-24T11:29:39Z</dc:date>
    <item>
      <title>Get Sum of a measure in row context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Sum-of-a-measure-in-row-context/m-p/2535999#M71266</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table of Assignments and a table Employees.&lt;/P&gt;&lt;P&gt;I want to get Howmany days in the filter are within every assignment start and end date ... to get the employee booking hours within the selected month and year only&lt;/P&gt;&lt;P&gt;For Example I selected Employee= Keerthi and month=March 2022 ... you can see that the column&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;**Demand_Days_of_task_in_period&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;will only count the days of this assignment that is within my date selection , so only march days are counted while feb and may are not.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The measure formula&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;** Demand_Days_of_task_in_period = CALCULATE(COUNTROWS('Date'),FILTER('Date','Date'[Date]&amp;gt;=MIN(Assignments[AssignmentStartDate])&amp;amp;&amp;amp;'Date'[Date]&amp;lt;=MIN(Assignments[AssignmentFinishDate])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&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;STRONG&gt;The requirement:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I want to access this measure out of row context, meaning that when I add it to a card it will sum all the rows values (6+1+1+1+2+2+2+2+1)= 18&amp;nbsp;&lt;/STRONG&gt;.. but as you can see the card on the top right which is with the same measure is giving me blank, it will only give me a value when I select a specific row ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I searched for it but found most ways are through creating a calculated column, while the measure here will depend on the user selection of the date&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 11:29:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Sum-of-a-measure-in-row-context/m-p/2535999#M71266</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-24T11:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get Sum of a measure in row context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Sum-of-a-measure-in-row-context/m-p/2542682#M71673</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can create another &lt;STRONG&gt;new measure&lt;/STRONG&gt; as below base on the current measure &lt;EM&gt;[Demand_Days_of_task_in_period]&lt;/EM&gt; and apply the new measure onto the Card visual...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure =
SUMX (
    GROUPBY ( 'Assignments', 'Assignments'[Employee Name], 'Assignments'[TaskName] ),
    [Demand_Days_of_task_in_period]
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;In addition, you can refer the method in the following links to handle with incorrect total values on the matrix visual...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DRii_6qkLNh8&amp;amp;data=05%7C01%7Cv-yiruan%40microsoft.com%7C0c51a123d5fe4b77474c08da388e17fd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637884480350106217%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&amp;amp;sdata=uanBhv9g6VRebMXnPD2qm48rpCQsqOt%2B5JPYsNiKR44%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKa7Ds4EAjNQ&amp;amp;data=05%7C01%7Cv-yiruan%40microsoft.com%7C0c51a123d5fe4b77474c08da388e17fd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637884480350262442%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&amp;amp;sdata=YFIk1ehxZz1R9J9NnWHyyivVtR%2FTxl%2BGREBW9xet9Vk%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;Dax for Power BI: Fixing Incorrect Measure Totals&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If the above one can't help you get the desired result, please provide some &lt;STRONG&gt;sample data&lt;/STRONG&gt; in your tables (&lt;STRONG&gt;&lt;I&gt;exclude &lt;/I&gt;&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;sensitive &lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt;&lt;I&gt;data&lt;/I&gt;&lt;/STRONG&gt;) with &lt;STRONG&gt;Text&lt;/STRONG&gt; format and your &lt;STRONG&gt;expected result&lt;/STRONG&gt; with backend logic and special examples. It is better if you can share a &lt;STRONG&gt;simplified&lt;/STRONG&gt; pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=05%7C01%7Cv-yiruan%40microsoft.com%7C0c51a123d5fe4b77474c08da388e17fd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637884480350262442%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&amp;amp;sdata=9B2oqUv4rMfQ0eA4TiEczOuFCn9TM6e8uDy%2BFAHFg3E%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 03:10:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Sum-of-a-measure-in-row-context/m-p/2542682#M71673</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-27T03:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get Sum of a measure in row context</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Sum-of-a-measure-in-row-context/m-p/2545092#M71807</link>
      <description>&lt;P&gt;Thank you so much, That helped alot&lt;/P&gt;</description>
      <pubDate>Sat, 28 May 2022 07:54:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Get-Sum-of-a-measure-in-row-context/m-p/2545092#M71807</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-28T07:54:31Z</dc:date>
    </item>
  </channel>
</rss>

