<?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 Cumulative A B C -&amp;gt; 3A+2B+C in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-A-B-C-gt-3A-2B-C/m-p/3862881#M150912</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;My data set is like this&lt;/P&gt;&lt;P&gt;2024 | 2025 [ 2026&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to créate a line chart&amp;nbsp; whith a dax function like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2024 = A&lt;/P&gt;&lt;P&gt;2025 = A+A+B&lt;/P&gt;&lt;P&gt;2026 = A+A+A +B+B+C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanx for your help&lt;/P&gt;</description>
    <pubDate>Tue, 23 Apr 2024 15:49:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-04-23T15:49:04Z</dc:date>
    <item>
      <title>Cumulative A B C -&gt; 3A+2B+C</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-A-B-C-gt-3A-2B-C/m-p/3862881#M150912</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;My data set is like this&lt;/P&gt;&lt;P&gt;2024 | 2025 [ 2026&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to créate a line chart&amp;nbsp; whith a dax function like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2024 = A&lt;/P&gt;&lt;P&gt;2025 = A+A+B&lt;/P&gt;&lt;P&gt;2026 = A+A+A +B+B+C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanx for your help&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 15:49:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-A-B-C-gt-3A-2B-C/m-p/3862881#M150912</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-23T15:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative A B C -&gt; 3A+2B+C</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-A-B-C-gt-3A-2B-C/m-p/3863600#M150930</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;
&lt;P&gt;You can try such a calculated column:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;In plain text for convenience:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Result = 
VAR currentYear = [Year]
VAR _tbl1 = FILTER ( data, [Year] &amp;lt;= currentYear )
VAR _tbl2 = ADDCOLUMNS ( _tbl1, "@mult", currentYear - [Year] + 1 )
VAR _tbl3 = ADDCOLUMNS ( _tbl2, "@res", [@mult] * [Value] )
RETURN SUMX ( _tbl3, [@res] )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Best Regards, &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Alexander&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@powerbi-vlog" target="_blank"&gt;My YouTube vlog in English&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@pbi-vlog" target="_blank"&gt;My YouTube vlog in Russian&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 22:00:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-A-B-C-gt-3A-2B-C/m-p/3863600#M150930</guid>
      <dc:creator>barritown</dc:creator>
      <dc:date>2024-04-23T22:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Cumulative A B C -&gt; 3A+2B+C</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-A-B-C-gt-3A-2B-C/m-p/3868066#M151114</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my sort of solution for your problem.. This is little bit lengthy but can give you optimum desired result.&lt;/P&gt;&lt;P&gt;Step 1 :&lt;BR /&gt;Transform your data in PQ. Below is the complete code.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;let
    Source = Data,
    #"Demoted Headers" = Table.DemoteHeaders(Source),
    #"Transposed Table" = Table.Transpose(#"Demoted Headers"),
    #"Renamed Columns" = Table.RenameColumns(#"Transposed Table",{{"Column1", "Year"}, {"Column2", "Item"}, {"Column3", "Value"}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Value", Int64.Type}}),
    Year = #"Changed Type"[Year],
    Custom1 = #"Changed Type",
    #"Added Index1" = Table.AddIndexColumn(Custom1, "Index", 1, 1, Int64.Type),
    #"Added Index" = Table.AddIndexColumn(#"Added Index1", "Rows", List.Count(Year), -1, Int64.Type),
    #"Added Custom" = Table.AddColumn(#"Added Index", "GenerateRows", each List.Repeat({ [Index] },[Rows])),
    #"Expanded GenerateRows" = Table.ExpandListColumn(#"Added Custom", "GenerateRows"),
    #"Removed Other Columns" = Table.SelectColumns(#"Expanded GenerateRows",{"Year", "Item", "Value", "Index"}),
    #"Added Index2" = Table.AddIndexColumn(#"Removed Other Columns", "Index.1", 1, 1, Int64.Type),
    #"Renamed Columns1" = Table.RenameColumns(#"Added Index2",{{"Index.1", "Flag"}})
in
    #"Renamed Columns1"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Step 2 :&lt;BR /&gt;Create a Calculated Column for generating new year. Below is the DAX code.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NewYear = 
VAR _YearFlag = 
RANK(
    SKIP,SUMMARIZE( ALLSELECTED( 'Table' ),'Table'[Year],'Table'[Item],'Table'[Value],'Table'[Index],'Table'[Flag] ),
    ORDERBY( 'Table'[Flag],ASC ),,PARTITIONBY( 'Table'[Item] )
) - 1
VAR _Result = 
 'Table'[Year] + _YearFlag

RETURN
_Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step 3 :&lt;/P&gt;&lt;P&gt;Create a cumulative measure. Below is the DAX code&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cumulative Measure = 
 CALCULATE(
    SUM( 'Table'[Value] ),
    WINDOW( 
        1,ABS,
        0,REL,
    SUMMARIZE( ALLSELECTED('Table' ),'Table'[Year],'Table'[Item],'Table'[Flag],'Table'[Value],'Table'[NewYear] ),
    ORDERBY( 'Table'[Flag], ASC ),
    PARTITIONBY( 'Table'[Item] )
    ) )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the&amp;nbsp; output ss&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Below is the attached pbix file.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.transfernow.net/dl/20240425Hapf5UDK" target="_blank"&gt;https://www.transfernow.net/dl/20240425Hapf5UDK&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope, it will help you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;sanalytics&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2024 10:49:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Cumulative-A-B-C-gt-3A-2B-C/m-p/3868066#M151114</guid>
      <dc:creator>sanalytics</dc:creator>
      <dc:date>2024-04-25T10:49:52Z</dc:date>
    </item>
  </channel>
</rss>

