<?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: Quick calculation of a waterfall using multiple measures in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quick-calculation-of-a-waterfall-using-multiple-measures/m-p/3014316#M102314</link>
    <description>&lt;P&gt;Thank you very much &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;for your help.&lt;/P&gt;&lt;P&gt;I think I have understood, on a technical level - thanks to your file and the documentation provided - what to do. I'll try to implement this on my file and let you know when it's done!&lt;/P&gt;&lt;P&gt;Jacques&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2023 15:44:19 GMT</pubDate>
    <dc:creator>j_78</dc:creator>
    <dc:date>2023-01-11T15:44:19Z</dc:date>
    <item>
      <title>Quick calculation of a waterfall using multiple measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quick-calculation-of-a-waterfall-using-multiple-measures/m-p/3012268#M102178</link>
      <description>&lt;P&gt;Hi everyone!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It's been a few months since I discovered DAX, but I'm coming to you because I'm struggling with the creation of a visual, with a bad execution time for the moment.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Context:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have created several complex metrics (to do a financial analysis by breaking down effects), but I am satisfied with the execution time (3 seconds max). Let's call them &lt;EM&gt;[Value1], [Value2], ..., [Value 14]&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Objective:&lt;/STRONG&gt;&lt;BR /&gt;I would like to create a waterfall chart from these measures. To do so, I followed the proposal of &lt;A href="https://community.powerbi.com/t5/Desktop/Waterfall-Chart-using-multiple-measures/m-p/439275" target="_self"&gt;this link&lt;/A&gt;, by creating a workaround in DAX formula and a control table.&lt;/P&gt;&lt;P&gt;This gives the following measure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    SWITCH (
        SELECTEDVALUE ( Table1[Index] ),
        1, [Value 1],
        2, [Value 1],
        3, [Value 1],
        ...,
        14, [Value 14],
        BLANK()
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem encountered:&lt;/STRONG&gt;&lt;BR /&gt;I can make the desired waterfall. But the computation time is very long (around 30 seconds), whereas I can make appear in cards in less than 3 seconds all the measures I want to make appear in this waterfall.&lt;/P&gt;&lt;P&gt;Could you please give me some advice to improve the performance of my formula to create my waterfall (my hunch is that every measure is recalculated in my formula for the waterfall, resulting in an explosion of execution time)?&lt;/P&gt;&lt;P&gt;Thanks for your help!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(I can provide a file with anonymized data if my explanations are not clear)&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 21:58:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quick-calculation-of-a-waterfall-using-multiple-measures/m-p/3012268#M102178</guid>
      <dc:creator>j_78</dc:creator>
      <dc:date>2023-01-10T21:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Quick calculation of a waterfall using multiple measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quick-calculation-of-a-waterfall-using-multiple-measures/m-p/3012368#M102186</link>
      <description>&lt;P&gt;There's a somewhat complicated way to do this with calculation groups that tends to be significantly better performance-wise.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For background, I recommend reading the following:&lt;BR /&gt;&lt;A href="https://data-goblins.com/power-bi/measure-selection" target="_blank"&gt;https://data-goblins.com/power-bi/measure-selection&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sqlbi.com/articles/using-calculation-groups-to-selectively-replace-measures-in-dax-expressions/" target="_blank"&gt;https://www.sqlbi.com/articles/using-calculation-groups-to-selectively-replace-measures-in-dax-expressions/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm attaching a pbix where I've implemented this as described in the above articles along with a slightly simpler method that works as follows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Define a new Calculation Group with each calculation item Value 1 = [Value 1], Value 2 = [Value 2], etc.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;^^ Tabular Editor 2 ^^&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can drag them around to sort the order and it automatically creates an ordinal column for sorting. That starts at 0 though, so you can define a calculated column on the CalcGroup table as&amp;nbsp;CalcGroup[Ordinal] + 1.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now define the measure to replace your switching measure as&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;CALCULATE ( [DummyMeasure], CalcGroup )&lt;/LI-CODE&gt;
&lt;P&gt;It doesn't matter what measure you put in the first argument because it gets replaced when you use CalcGroup as filter context.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now use the CalcGroup index and this new measure in your waterfall chart.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jan 2023 23:21:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quick-calculation-of-a-waterfall-using-multiple-measures/m-p/3012368#M102186</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2023-01-10T23:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Quick calculation of a waterfall using multiple measures</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quick-calculation-of-a-waterfall-using-multiple-measures/m-p/3014316#M102314</link>
      <description>&lt;P&gt;Thank you very much &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="39298" data-lia-user-login="AlexisOlson" class="lia-mention lia-mention-user"&gt;AlexisOlson&lt;/a&gt;&amp;nbsp;for your help.&lt;/P&gt;&lt;P&gt;I think I have understood, on a technical level - thanks to your file and the documentation provided - what to do. I'll try to implement this on my file and let you know when it's done!&lt;/P&gt;&lt;P&gt;Jacques&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 15:44:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Quick-calculation-of-a-waterfall-using-multiple-measures/m-p/3014316#M102314</guid>
      <dc:creator>j_78</dc:creator>
      <dc:date>2023-01-11T15:44:19Z</dc:date>
    </item>
  </channel>
</rss>

