<?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: How to calculate the estimate hour per day per project with realized hours in the same visual? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-estimate-hour-per-day-per-project-with/m-p/2329706#M58477</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="332147" data-lia-user-login="v-zhangti" class="lia-mention lia-mention-user"&gt;v-zhangti&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, that doesn't answer the question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result I'm trying to achieve is to validate if we're going under the hourly budget or if it's costing us more time before we get to the end of the project.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;To get closer to this result, I had to add a Start Date column to my data. I managed to get the desired modeling with this DAX formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Estimate Hours 4 = 
CALCULATE (
    DATEDIFF (
        SELECTEDVALUE ( 'Table'[Start Date] ),
        SELECTEDVALUE ( Dates[Date] ),
        DAY
    )
        * DIVIDE ( SELECTEDVALUE ( 'Table'[Total Estimate Hours] ), [Datediff] ),
    ALLEXCEPT ( Dates, Dates[Date] )
)&lt;/LI-CODE&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;I still have the concern to have the estimated hours beyond the realized data. Here is a dummy example that I want to achieve:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here what my model looks like:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Feb 2022 03:31:25 GMT</pubDate>
    <dc:creator>Anthony_2022</dc:creator>
    <dc:date>2022-02-10T03:31:25Z</dc:date>
    <item>
      <title>How to calculate the estimate hour per day per project with realized hours in the same visual?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-estimate-hour-per-day-per-project-with/m-p/2317849#M57811</link>
      <description>&lt;P&gt;I try to present the realized hours versus the planned hours for several projects in the same graph.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've done a lot of research, the answers revolve around creating a calculate column to get the estimated hours. This always answers the need of the original question. However, in my case, it can't work since I have several projects, therefore several estimates. I don't see how to procedurally create these calculated columns. (In my real data, I have several hundred projects)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to get the expected number of hours for each day. However, the planned hours stop where the last hour entered is.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I suspect that this is a matter of filters or assigning a new date table to the DAX formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have another table that consists of a table of dates. The relationship between the two tables is on the date column.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data sample :&lt;/P&gt;&lt;P&gt;Dates | Project Hours | End_Date | Total_Estimate_Hours&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;2022-02-01&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-02&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-03&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-04&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-05&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-06&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-07&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-08&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-09&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-10&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-11&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-12&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-13&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-14&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-15&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-16&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-17&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-18&lt;/TD&gt;&lt;TD&gt;Project A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2022-02-28&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-01&lt;/TD&gt;&lt;TD&gt;Project B&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2022-02-26&lt;/TD&gt;&lt;TD&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-03&lt;/TD&gt;&lt;TD&gt;Project B&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2022-02-26&lt;/TD&gt;&lt;TD&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-04&lt;/TD&gt;&lt;TD&gt;Project B&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2022-02-26&lt;/TD&gt;&lt;TD&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-09&lt;/TD&gt;&lt;TD&gt;Project B&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2022-02-26&lt;/TD&gt;&lt;TD&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-10&lt;/TD&gt;&lt;TD&gt;Project B&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;2022-02-26&lt;/TD&gt;&lt;TD&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-12&lt;/TD&gt;&lt;TD&gt;Project B&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2022-02-26&lt;/TD&gt;&lt;TD&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-13&lt;/TD&gt;&lt;TD&gt;Project B&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;2022-02-26&lt;/TD&gt;&lt;TD&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2022-02-16&lt;/TD&gt;&lt;TD&gt;Project B&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2022-02-26&lt;/TD&gt;&lt;TD&gt;28&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 03 Feb 2022 14:25:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-estimate-hour-per-day-per-project-with/m-p/2317849#M57811</guid>
      <dc:creator>Anthony_2022</dc:creator>
      <dc:date>2022-02-03T14:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the estimate hour per day per project with realized hours in the same visual?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-estimate-hour-per-day-per-project-with/m-p/2317901#M57815</link>
      <description>&lt;P&gt;I don't really understand your sample data vs the screenshots you posted.&amp;nbsp; It looks like the actual and estimated hours in your graphs are cumulative sums.&amp;nbsp; Can you post the raw data for hours and estimates for a couple of projects along with your measure defintions?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 14:54:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-estimate-hour-per-day-per-project-with/m-p/2317901#M57815</guid>
      <dc:creator>AUaero</dc:creator>
      <dc:date>2022-02-03T14:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the estimate hour per day per project with realized hours in the same visual?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-estimate-hour-per-day-per-project-with/m-p/2317927#M57819</link>
      <description>&lt;P&gt;I'm sorry, I forgot to put the DAX formulas. I hadn't included them since I intended to add a PBIX file, but I couldn't find a way to attach it to the post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the DAX formula for realized hours:&lt;/P&gt;&lt;PRE&gt;Realized hours = 
VAR LastVisibleDate = MAX(Dates[Date])
Var FirstVisibleDate = MIN(Dates[Date])
Var LastDateWithHours = CALCULATE(MAX('Table'[Dates]),REMOVEFILTERS())
Var Result = IF(FirstVisibleDate &amp;lt;= LastDateWithHours, CALCULATE(SUM('Table'[Hours]),dates[date] &amp;lt;= LastVisibleDate))
return Result&lt;/PRE&gt;&lt;DIV class="s-prose js-post-body"&gt;&lt;P&gt;Here is the DAX formula for estimated hours:&lt;/P&gt;&lt;PRE&gt;Estimate Hours = 
VAR LastVisibleDate = MAX('Table'[End Date])
Var FirstVisibleDate = MIN(Dates[Date])
VAR DayBetweenDates = DATEDIFF(FirstVisibleDate,LastVisibleDate,DAY)

return SELECTEDVALUE('Table'[Total Estimate Hours])/DayBetweenDates&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV class="mt24 mb12"&gt;&lt;DIV class="post-taglist d-flex gs4 gsy fd-column"&gt;&lt;DIV class="d-flex ps-relative fw-wrap"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;The sample data are identical to my source data, they have been ultra simplified to facilitate finding a solution.&lt;/P&gt;&lt;P&gt;The hours data have been aggregated for performance reasons. Initially, it was a table with multiple rows per day per user per project.&lt;/P&gt;&lt;P&gt;The projects data was a table by itself. It was combined with the previous table to facilitate the application of filters and measurements. This seemed to be the best decision in terms of performance, but I haven't measured it until now because of the concern initially presented.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 15:08:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-estimate-hour-per-day-per-project-with/m-p/2317927#M57819</guid>
      <dc:creator>Anthony_2022</dc:creator>
      <dc:date>2022-02-03T15:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the estimate hour per day per project with realized hours in the same visual?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-estimate-hour-per-day-per-project-with/m-p/2327263#M58319</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="230876" data-lia-user-login="Anthony_2022" class="lia-mention lia-mention-user"&gt;Anthony_2022&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What kind of results do you expect? I have made some adjustments, please check if it meets your needs.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Realized hours = 
VAR LastVisibleDate = SELECTEDVALUE('Table'[Date])
Var FirstVisibleDate = CALCULATE(MIN('Table'[Date]),FILTER(ALL('Table'),[Project]=MAX('Table'[Project])))
Var LastDateWithHours = CALCULATE(MAX('Table'[Date]),REMOVEFILTERS())
Var Result = IF(FirstVisibleDate &amp;lt;= LastDateWithHours, CALCULATE(SUM('Table'[Hours]),FILTER(ALL('Table'),'Table'[Date] &amp;lt;=LastVisibleDate&amp;amp;&amp;amp;[Project]=MAX('Table'[Project]))))
return Result&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Estimate Hours = 
VAR LastVisibleDate = SELECTEDVALUE('Table'[End_Date])
Var FirstVisibleDate = MIN('Table'[Date])
VAR DayBetweenDates = DATEDIFF(FirstVisibleDate,LastVisibleDate,DAY)
return SELECTEDVALUE('Table'[Total_Estimate_Hours])/DayBetweenDates&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If the method I provided above can't solve your problem, what's your expected result?&amp;nbsp;Please provide a display photo of the desired result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _Charlotte&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 05:46:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-estimate-hour-per-day-per-project-with/m-p/2327263#M58319</guid>
      <dc:creator>v-zhangti</dc:creator>
      <dc:date>2022-02-09T05:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the estimate hour per day per project with realized hours in the same visual?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-estimate-hour-per-day-per-project-with/m-p/2329706#M58477</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="332147" data-lia-user-login="v-zhangti" class="lia-mention lia-mention-user"&gt;v-zhangti&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, that doesn't answer the question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result I'm trying to achieve is to validate if we're going under the hourly budget or if it's costing us more time before we get to the end of the project.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;To get closer to this result, I had to add a Start Date column to my data. I managed to get the desired modeling with this DAX formula:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Estimate Hours 4 = 
CALCULATE (
    DATEDIFF (
        SELECTEDVALUE ( 'Table'[Start Date] ),
        SELECTEDVALUE ( Dates[Date] ),
        DAY
    )
        * DIVIDE ( SELECTEDVALUE ( 'Table'[Total Estimate Hours] ), [Datediff] ),
    ALLEXCEPT ( Dates, Dates[Date] )
)&lt;/LI-CODE&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;I still have the concern to have the estimated hours beyond the realized data. Here is a dummy example that I want to achieve:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Here what my model looks like:&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2022 03:31:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-the-estimate-hour-per-day-per-project-with/m-p/2329706#M58477</guid>
      <dc:creator>Anthony_2022</dc:creator>
      <dc:date>2022-02-10T03:31:25Z</dc:date>
    </item>
  </channel>
</rss>

