<?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: Calculate running total for missing values, showing blank in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1435499#M26815</link>
    <description>Anonymous&lt;/LI-USER&gt;&lt;BR /&gt;&lt;BR /&gt;If you think about it deeply, it only makes sense that your graph looks the way it does. Think about the financial year where you don't see the values. You don't see them because in your formula you put VALUES(Output_SSIS[Asset type]). But for these years, when they are visible in the context, there are NO asset types, so your filter is empty in these years and this, of course, affects all the years that are filtered in your formula, hence your measure must return nothing. This all stems from the fact that you're taking all values from the fact table (one-table models should never be used in professional settings, only star schemas). If you had a dimension with your types, your selected type(s) (say, via a slicer, for instance) would be visible all the time regardless of other choices elsewhere. Hence, your formula would work OK without even putting VALUES(...) in the formula. Just stick to correct models and you'll be safe.</description>
    <pubDate>Thu, 15 Oct 2020 09:17:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-10-15T09:17:20Z</dc:date>
    <item>
      <title>Calculate running total for missing values, showing blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1426748#M26588</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am building a report to represent the cumulative of a column (the cashflow) over time (different years) based on some categories (i.e. different asset_types). The problem is that not all the years have an equivalent value and consequently these years are shown blank in my bar chart. I was wondering if someone let me know how to fix my DAX query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3-Cumalative Cash Flows = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE (sum (Output_SSIS [Cash Flow]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;filter(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALLselected (Output_SSIS),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Output_SSIS [Financial Year] &amp;lt;= Max (Output_SSIS [Financial Year])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),VALUES(Output_SSIS[Asset type])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;-- This is shown as the value for each column&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Total Cumalative Cash Flow = CALCULATE( sum(Output_SSIS[Cash Flow]),filter(ALLSELECTED(Output_SSIS),Output_SSIS[Financial Year]&amp;lt;=Max(Output_SSIS[Financial Year])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This is shown as line on top of the chart&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The orange category (asset_type) does not have any record(cash flow) for the last three years of the x-axis and that is the reason it is shown as blank.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any help is highly appreciated.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Oct 2020 03:19:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1426748#M26588</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-20T03:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate running total for missing values, showing blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1426967#M26591</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , &lt;/P&gt;
&lt;P&gt;Try like&lt;/P&gt;
&lt;P&gt;CALCULATE (sum (Output_SSIS [Cash Flow]),&lt;BR /&gt;filter(&lt;BR /&gt;ALLselected (Output_SSIS),&lt;BR /&gt;Output_SSIS [Financial Year] &amp;lt;= Max (Output_SSIS [Financial Year])&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;CALCULATE (sum (Output_SSIS [Cash Flow]),&lt;BR /&gt;filter(&lt;BR /&gt;ALLselected (Output_SSIS),&lt;BR /&gt;Output_SSIS [Financial Year] &amp;lt;= Max (Output_SSIS [Financial Year]) &amp;amp;&amp;amp; Output_SSIS[Asset type] = max(Output_SSIS[Asset type])&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 04:45:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1426967#M26591</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-10-12T04:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate running total for missing values, showing blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1427004#M26594</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Amit, but none of them works&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;&lt;P&gt;and the second one&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I need to modify the calculation somehow to force it to use &lt;SPAN&gt;Output_SSIS [Financial Year]&lt;/SPAN&gt;-1 if isblanck(&lt;SPAN&gt;Output_SSIS [Financial Year])&lt;/SPAN&gt;&amp;nbsp; with some if statements possibly with some variables, but not sure exactly how but working on it&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2020 05:48:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1427004#M26594</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-12T05:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate running total for missing values, showing blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1433280#M26736</link>
      <description>This is what happens when you build a model that does not follow Best Practices, that is, the star schema. Please build a correct model and your problems will be gone. Here's something to get you started: &lt;A href="https://docs.microsoft.com/en-us/power-bi/guidance/star-schema" target="_blank"&gt;https://docs.microsoft.com/en-us/power-bi/guidance/star-schema&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Here's why you've got problems of this kind. You've only got one big table, Output_SSIS, and for some dates some types are not present in it. Therefore, when you start filtering, some values will be missing in the context. In your case it's VALUES(...) that is causing the problem (in fact, you're causing the problem, not the function). If you use a proper dimension for Asset Type, this problem will immediately be gone since choices made in dimensions stay put regardless of what's in the fact table. Please therefore structure your models correctly in the first place.</description>
      <pubDate>Wed, 14 Oct 2020 12:46:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1433280#M26736</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-14T12:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate running total for missing values, showing blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1434052#M26756</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi there, thanks for the link, I never thought these issues can be fixed with an appropriate data model. I was always seeing these concepts in the field of data model not DAX queries. The link looks very interesting, I will go through this (and the if clause) over the next few days and report back.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 18:52:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1434052#M26756</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-14T18:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate running total for missing values, showing blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1435499#M26815</link>
      <description>Anonymous&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;If you think about it deeply, it only makes sense that your graph looks the way it does. Think about the financial year where you don't see the values. You don't see them because in your formula you put VALUES(Output_SSIS[Asset type]). But for these years, when they are visible in the context, there are NO asset types, so your filter is empty in these years and this, of course, affects all the years that are filtered in your formula, hence your measure must return nothing. This all stems from the fact that you're taking all values from the fact table (one-table models should never be used in professional settings, only star schemas). If you had a dimension with your types, your selected type(s) (say, via a slicer, for instance) would be visible all the time regardless of other choices elsewhere. Hence, your formula would work OK without even putting VALUES(...) in the formula. Just stick to correct models and you'll be safe.</description>
      <pubDate>Thu, 15 Oct 2020 09:17:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1435499#M26815</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-15T09:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate running total for missing values, showing blank</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1443068#M27019</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for the explanation and also the link. It was very educational,.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have formed a star schema by breaking my big table into smaller ones by some DAX expressions such as&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim_Asset_type = DISTINCT(Output_SSIS[Asset Type])&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;So the whole * schema is shown below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I put some filtering options below my chart which are coming from these dimensions and I use them to filter the chart values.&lt;/P&gt;&lt;P&gt;But still do not know how to modify my cumulative and total value (also a dax expression) to use these filters. The Y axis shows incorrect values, repetetive values, I guess it is because of the "allselected" function in the dax, please see below&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Now my cumulative is :&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Cumulative Cash Flow = CALCULATE (sum (Output_SSIS [Cash Flow]),filter(ALLSELECTED(Output_SSIS),Output_SSIS [Financial Year] &amp;lt;= Max (Year_Table[Financial Year])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It shows the year correctly (i.e. no missing values) but it does not bring the correct values as I explained earlier. I appreciate that if you could advise.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;and another try:&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Cumulative Cash Flow = CALCULATE (sum (Output_SSIS [Cash Flow]),filter(ALLSELECTED(Output_SSIS),Output_SSIS [Financial Year] &amp;lt;= Max (Year_Table[Financial Year])),FILTER(Output_SSIS,Output_SSIS[Asset Type]=ALLSELECTED(Dim_Asset_type[Asset Type])),FILTER(Output_SSIS,Output_SSIS[Project Type]=ALLSELECTED(Dim_PrjType[Project Type])),FILTER(Output_SSIS,Output_SSIS[Precinct]=ALLSELECTED(Dim_Precinct[Precinct])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;And another try&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Cumulative Cash Flow = CALCULATE (sum (Output_SSIS [Cash Flow]),filter(ALLSELECTED(Output_SSIS),Output_SSIS [Financial Year] &amp;lt;= Max (Year_Table[Financial Year]) &amp;amp;&amp;amp; Output_SSIS[Asset Type] in ALLSELECTED(Dim_Asset_type[Asset Type]) &amp;amp;&amp;amp; Output_SSIS[Project Type] in ALLSELECTED(Dim_PrjType[Project Type]) &amp;amp;&amp;amp; Output_SSIS[Precinct] in ALLSELECTED(Dim_Precinct[Precinct])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;I think I have fixed that, finally !!, I had to put values at the end, so the code is :&lt;/STRONG&gt;&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Cumulative Cash Flow = CALCULATE (sum (Output_SSIS [Cash Flow]),filter(filter(ALLSELECTED(Output_SSIS),Output_SSIS[Financial Year] &amp;lt;= Max (Year_Table[Financial Year])), Output_SSIS[Asset Type] in ALLSELECTED(Dim_Asset_type[Asset Type]) &amp;amp;&amp;amp; Output_SSIS[Project Type] in ALLSELECTED(Dim_PrjType[Project Type]) &amp;amp;&amp;amp; Output_SSIS[Precinct] in ALLSELECTED(Dim_Precinct[Precinct])),VALUES(Dim_Asset_type[Asset Type]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;But if this is the solution, can you explain why the values should be at the end, it seems it select distinct values but sitll cannot figure it out why I need to enforce it&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2020 03:05:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-running-total-for-missing-values-showing-blank/m-p/1443068#M27019</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-10-20T03:05:45Z</dc:date>
    </item>
  </channel>
</rss>

