<?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: Show value as 0 before certain date otherwise show value based on filters applied in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-as-0-before-certain-date-otherwise-show-value-based/m-p/2896487#M94196</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Simply Try like &lt;/P&gt;
&lt;P&gt;CALCULATE(MAX(Historical_allocation_total[DATE]),Historical_allocation_total[DATE] = TODAY()) +0 &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;SUM('Historical_allocation_total'[CPU consumed (GHz)]) +0 &lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2022 02:21:39 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2022-11-10T02:21:39Z</dc:date>
    <item>
      <title>Show value as 0 before certain date otherwise show value based on filters applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-as-0-before-certain-date-otherwise-show-value-based/m-p/2896337#M94181</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seeking help solving a DAX problem.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a DAX measure which would set all values before current date to 0 otherwise show the expected value.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CPU forecast_WIP =&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;currentdate&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Historical_allocation_total[DATE]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;Historical_allocation_total[DATE]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;())&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt; &lt;SPAN&gt;VALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ALLSELECTED&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Historical_allocation_total[DATE]&lt;/SPAN&gt;&lt;SPAN&gt;) &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;currentdate&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Historical_allocation_total&lt;/SPAN&gt;&lt;SPAN&gt;[CPU_forecast]&lt;/SPAN&gt;&lt;SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Historical_allocation_total&lt;/SPAN&gt;&lt;SPAN&gt;[CPU consumed up until forecast]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Historical_allocation_total[DATE]&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;))))&lt;BR /&gt;&lt;BR /&gt;This does not work. I get an error = a table of multiple values was supplied where a single value was expected.&lt;BR /&gt;&lt;BR /&gt;How should I structure this DAX logic to make sense?&lt;BR /&gt;Basically on this graph I want the yellow line to start where the pink one is ending. That part is okay, but the first part I dont want to be there.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;The other 2 measure defined in the previous one consist of CPU_forecast which is just a cumulative sum by date and this one to determine the sum today which I am then adding to the forecast, so the forecast starts at a value where todays data end.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CPU consumed up until forecast = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Historical_allocation_total'[CPU consumed (GHz)]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Historical_allocation_total&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Historical_allocation_total&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Historical_allocation_total[DATE]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;()))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;Any help please?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Nov 2022 22:57:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-as-0-before-certain-date-otherwise-show-value-based/m-p/2896337#M94181</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-09T22:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Show value as 0 before certain date otherwise show value based on filters applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-as-0-before-certain-date-otherwise-show-value-based/m-p/2896487#M94196</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Simply Try like &lt;/P&gt;
&lt;P&gt;CALCULATE(MAX(Historical_allocation_total[DATE]),Historical_allocation_total[DATE] = TODAY()) +0 &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;SUM('Historical_allocation_total'[CPU consumed (GHz)]) +0 &lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 02:21:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-as-0-before-certain-date-otherwise-show-value-based/m-p/2896487#M94196</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-11-10T02:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Show value as 0 before certain date otherwise show value based on filters applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-as-0-before-certain-date-otherwise-show-value-based/m-p/2896955#M94228</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please &lt;STRONG&gt;update&lt;/STRONG&gt; the formula of measure&lt;EM&gt; &lt;STRONG&gt;[CPU consumed up until forecast]&lt;/STRONG&gt; &lt;/EM&gt;and &lt;STRONG&gt;&lt;EM&gt;[CPU forecast_WIP]&lt;/EM&gt; &lt;/STRONG&gt;as below and check if you can get the expected result...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CPU consumed up until forecast =
VAR _seldate =
    SELECTEDVALUE ( Historical_allocation_total[DATE] )
RETURN
    CALCULATE (
        SUM ( 'Historical_allocation_total'[CPU consumed (GHz)] ),
        FILTER (
            ALLSELECTED ( Historical_allocation_total ),
            Historical_allocation_total[DATE] &amp;gt;= TODAY ()
                &amp;amp;&amp;amp; Historical_allocation_total[DATE] &amp;lt;= _seldate
        )
    )&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;CPU forecast_WIP =
IF (
    SELECTEDVALUE ( Historical_allocation_total[DATE] ) &amp;lt; TODAY (),
    0,
    Historical_allocation_total[CPU_forecast] + Historical_allocation_total[CPU consumed up until forecast]
)&lt;/LI-CODE&gt;
&lt;P&gt;If the above one is not working, please provide some &lt;STRONG&gt;sample data&lt;/STRONG&gt; in the table &lt;STRONG&gt;'&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;Historical_allocation_total'&lt;/STRONG&gt;&amp;nbsp;with &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Text&lt;/FONT&gt; &lt;/STRONG&gt;format and the calculation logic [CPU forecast (GHz)], [CPU consume(GHz)] and [CPU consumed up until forecast] with the special examples.&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;SPAN&gt;It is better&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&lt;/FONT&gt;if you can share a&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;&lt;SPAN&gt;simplified&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&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 style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&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=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%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 style="background: white; box-sizing: border-box; font-variant-ligatures: normal; font-variant-caps: normal; orphans: 2; text-align: start; widows: 2; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; word-spacing: 0px; margin: 7.5pt 0in 0in 0in;"&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 08:09:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-as-0-before-certain-date-otherwise-show-value-based/m-p/2896955#M94228</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-10T08:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Show value as 0 before certain date otherwise show value based on filters applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-as-0-before-certain-date-otherwise-show-value-based/m-p/2897078#M94240</link>
      <description>&lt;P&gt;This is working exactly as I wanted! Thank you very much for such a swift help. Appreciate it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 09:05:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-value-as-0-before-certain-date-otherwise-show-value-based/m-p/2897078#M94240</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-11-10T09:05:04Z</dc:date>
    </item>
  </channel>
</rss>

