<?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: Problem with Grand Total of Measure in HASONEVALUE in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3740550#M145853</link>
    <description>&lt;P&gt;Unfortunately, it didnt work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The screenshot below shows what the issue is. Unfortunately I cant attched the PBIX as I dont see the option to here&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;</description>
    <pubDate>Mon, 04 Mar 2024 16:22:48 GMT</pubDate>
    <dc:creator>Bunmz_a</dc:creator>
    <dc:date>2024-03-04T16:22:48Z</dc:date>
    <item>
      <title>Problem with Grand Total of Measure in HASONEVALUE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3736250#M145628</link>
      <description>&lt;P class=""&gt;&lt;SPAN class=""&gt;Please I am experiencing a challenge with my DAX measure&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;My objective is to calculate the total budget associated with each Workorder status however for Projected Workorders, the budget for Open and Initiated should be netted off till it gets to 0. Meaning the Budget measure would need to incorporate an adjustment for Projected Workorders&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;I have been able to do this successfully but the grand total does not work. &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;For the grand total, I am still getting a sum that reflect the original not adjusted projected budget regardless of the logic built into the measure &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Below is my measure. When I use ‘HASONEVALUE’ I get 0 as the grand total&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Please help &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;Budget = &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR WOstatus =&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; FIRSTNONBLANK ( 'Projected WO'[WO_Status], 1 )&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR BudgetTotal =&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; CALCULATE (&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUM ( Budget[Amount] ),&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FILTER ( Budget, Budget[BudgetType] = "Budget" )&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR ProjectedAmount =&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; CALCULATE (&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BudgetTotal,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Projected WO'[WO_Status] IN { "Projected", "projected" }&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR InitiatedAmount =&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; CALCULATE (&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BudgetTotal,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Projected WO'[WO_Status] IN { "Initiated", "initiated" }&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR OpenAmount =&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; CALCULATE (&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BudgetTotal,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Projected WO'[WO_Status] IN { "open", "Open" }&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;VAR AdjustedProjectedAmount = MAX( (ProjectedAmount - InitiatedAmount - OpenAmount ), 0)&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 class=""&gt;&amp;nbsp; &amp;nbsp; IF (&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NOT ( WOstatus IN { "Projected", "projected" } ),&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BudgetTotal,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AdjustedProjectedAmount)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 12:22:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3736250#M145628</guid>
      <dc:creator>Bunmz_a</dc:creator>
      <dc:date>2024-03-01T12:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Grand Total of Measure in HASONEVALUE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3737111#M145673</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="698942" data-lia-user-login="Bunmz_a" class="lia-mention lia-mention-user"&gt;Bunmz_a&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try the following DAX:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Adjusted Budget = 
VAR BudgetTotal = 
    CALCULATE (
        SUM ( Budget[Amount] ),
        Budget[BudgetType] = "Budget"
    )
VAR ProjectedAmount = 
    CALCULATE (
        BudgetTotal,
        'Projected WO'[WO_Status] IN { "Projected", "projected" }
    )
VAR InitiatedAmount = 
    CALCULATE (
        BudgetTotal,
        'Projected WO'[WO_Status] IN { "Initiated", "initiated" }
    )
VAR OpenAmount = 
    CALCULATE (
        BudgetTotal,
        'Projected WO'[WO_Status] IN { "Open", "open" }
    )
VAR AdjustedProjectedAmount = 
    MAX( ProjectedAmount - InitiatedAmount - OpenAmount, 0 )
VAR IsTotal = 
    ISINSCOPE('Projected WO'[WO_Status])

RETURN
    IF (
        IsTotal,
        SUMX(
            VALUES('Projected WO'[WO_Status]),
            IF (
                'Projected WO'[WO_Status] IN { "Projected", "projected" },
                AdjustedProjectedAmount,
                BudgetTotal
            )
        ),
        IF (
            'Projected WO'[WO_Status] IN { "Projected", "projected" },
            AdjustedProjectedAmount,
            BudgetTotal
        )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 21:05:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3737111#M145673</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2024-03-01T21:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Grand Total of Measure in HASONEVALUE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3737188#M145681</link>
      <description>&lt;P&gt;Hi Sahir, it didn't work. I ended up with the same grand total which still reflects the original projected budget&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 22:08:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3737188#M145681</guid>
      <dc:creator>Bunmz_a</dc:creator>
      <dc:date>2024-03-01T22:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Grand Total of Measure in HASONEVALUE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3739065#M145773</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="698942" data-lia-user-login="Bunmz_a" class="lia-mention lia-mention-user"&gt;Bunmz_a&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;BudgetCorrectTotal =
VAR IsProjected =
    HASONEVALUE ( 'Projected WO'[WO_Status] )
        &amp;amp;&amp;amp; VALUES ( 'Projected WO'[WO_Status] ) IN { "Projected", "projected" }
VAR AdjustedProjectedAmount =
    IF (
        IsProjected,
        MAX ( ( [ProjectedAmount] - [InitiatedAmount] - [OpenAmount] ), 0 ),
        [BudgetTotal]
    )
RETURN
    IF (
        ISINSCOPE ( 'Projected WO'[WO_Status] ),
        AdjustedProjectedAmount,
        SUMX (
            VALUES ( 'Projected WO'[WO_Status] ),
            [AdjustedProjectedAmount]
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I would be grateful if you could provide me with sample data with the personal information erased.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any further questions please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 06:24:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3739065#M145773</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-04T06:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Grand Total of Measure in HASONEVALUE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3740550#M145853</link>
      <description>&lt;P&gt;Unfortunately, it didnt work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The screenshot below shows what the issue is. Unfortunately I cant attched the PBIX as I dont see the option to here&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;</description>
      <pubDate>Mon, 04 Mar 2024 16:22:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3740550#M145853</guid>
      <dc:creator>Bunmz_a</dc:creator>
      <dc:date>2024-03-04T16:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Grand Total of Measure in HASONEVALUE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3741411#M145906</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="698942" data-lia-user-login="Bunmz_a" class="lia-mention lia-mention-user"&gt;Bunmz_a&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You mean "Revised Budget" should be "$20,935,403" instead of "$20,946,636". I hope I understand correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Revised Budget = 
VAR WOstatus =
    FIRSTNONBLANK ( 'Projected WO'[WO Status], 1 )

VAR BudgetTotal =
    CALCULATE (
        SUM ( 'Workorder Data'[Budget (With Projected Adjustment)]))

    
VAR ProjectedAmount =
    CALCULATE (
        BudgetTotal,
        'Projected WO'[WO Status] IN { "Projected", "projected" }
    )

VAR InitiatedAmount =
    CALCULATE (
        BudgetTotal,
        'Projected WO'[WO Status] IN { "Initiated", "initiated" }
    )

VAR OpenAmount =
    CALCULATE (
        BudgetTotal,
        'Projected WO'[WO Status] IN { "open", "Open" }
    )

VAR AdjustedProjectedAmount = MAX( (ProjectedAmount - InitiatedAmount - OpenAmount ), 0)

RETURN
    IF (
        NOT ( WOstatus IN { "Projected", "projected" } ),
        BudgetTotal,
        AdjustedProjectedAmount
    )&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;pbix file is attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any further questions please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 05:24:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3741411#M145906</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-08T05:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Grand Total of Measure in HASONEVALUE</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3791854#M148171</link>
      <description>&lt;P&gt;Hi Sorry for the late response.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;this is not the solution as the Budget Total uses the column that already has the answers (which was just for illustrative purposes).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;in the original problem, Budget with Adjusted Projected Amount does not exist.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 15:30:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Problem-with-Grand-Total-of-Measure-in-HASONEVALUE/m-p/3791854#M148171</guid>
      <dc:creator>Bunmz_a</dc:creator>
      <dc:date>2024-03-26T15:30:51Z</dc:date>
    </item>
  </channel>
</rss>

