<?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: How to calculate accumulated percentage in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-accumulated-percentage/m-p/3712872#M144470</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="263569" data-lia-user-login="LotteLaugesen" class="lia-mention lia-mention-user"&gt;LotteLaugesen&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="569583" data-lia-user-login="Dangar332" class="lia-mention lia-mention-user"&gt;Dangar332&lt;/a&gt;&amp;nbsp;nice method! Thank you, for your quick response and the solution provided.&lt;BR /&gt;I am not sure how your semantic model looks like, but based on the sample and description you provided, I tried to create some dummy data.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please try code as below.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;% of Total = 
VAR Total_View = COUNTROWS(ALL('Table'))
RETURN
[Report Views] / Total_View&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Accum % = 
VAR Total_View = COUNTROWS(ALL('Table'))
RETURN
CALCULATE (
    DIVIDE ( SUMX(VALUES('Table'[Login name]),[Report Views]), Total_View ),
    FILTER (
        ALL ( 'Table'[Login name] ),
        'Table'[Login name] &amp;lt;= MAX ( 'Table'[Login name] )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;For further details，please find attachment.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Yulia Yan&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Feb 2024 03:12:23 GMT</pubDate>
    <dc:creator>v-weiyan1-msft</dc:creator>
    <dc:date>2024-02-21T03:12:23Z</dc:date>
    <item>
      <title>How to calculate accumulated percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-accumulated-percentage/m-p/3710440#M144361</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you calculate accumulated percentage when time is not involved?&lt;BR /&gt;It should accumulate per Logon name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;BR /&gt;Lotte&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 08:55:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-accumulated-percentage/m-p/3710440#M144361</guid>
      <dc:creator>LotteLaugesen</dc:creator>
      <dc:date>2024-02-20T08:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate accumulated percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-accumulated-percentage/m-p/3710934#M144379</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="263569" data-lia-user-login="LotteLaugesen" class="lia-mention lia-mention-user"&gt;LotteLaugesen&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;if time is not present for comparing purpose then use below method it might work&lt;BR /&gt;make a new column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Column 2 = 
var a = sumx(FILTER(ALL('Table'),'Table'[view]&amp;gt;EARLIER('Table'[view])),'Table'[view])
var b = 'Table'[view]+a
var c = SUM('Table'[view])
return
b/c&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&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 don't forgot to change&amp;nbsp; column type to percantage&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 11:59:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-accumulated-percentage/m-p/3710934#M144379</guid>
      <dc:creator>Dangar332</dc:creator>
      <dc:date>2024-02-20T11:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate accumulated percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-accumulated-percentage/m-p/3710997#M144383</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="569583" data-lia-user-login="Dangar332" class="lia-mention lia-mention-user"&gt;Dangar332&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for your answer, but 'Report Views' is a measure not a columnn in the table.&lt;BR /&gt;The table is not summarized, but has 1 record per view.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Report Views =&lt;/SPAN&gt; &lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;FT_PBI_ActivityLog&lt;/SPAN&gt;&lt;SPAN&gt;[ReportName]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;Do you have any other ideas?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Feb 2024 12:24:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-accumulated-percentage/m-p/3710997#M144383</guid>
      <dc:creator>LotteLaugesen</dc:creator>
      <dc:date>2024-02-20T12:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate accumulated percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-accumulated-percentage/m-p/3712872#M144470</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="263569" data-lia-user-login="LotteLaugesen" class="lia-mention lia-mention-user"&gt;LotteLaugesen&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="569583" data-lia-user-login="Dangar332" class="lia-mention lia-mention-user"&gt;Dangar332&lt;/a&gt;&amp;nbsp;nice method! Thank you, for your quick response and the solution provided.&lt;BR /&gt;I am not sure how your semantic model looks like, but based on the sample and description you provided, I tried to create some dummy data.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please try code as below.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;% of Total = 
VAR Total_View = COUNTROWS(ALL('Table'))
RETURN
[Report Views] / Total_View&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Accum % = 
VAR Total_View = COUNTROWS(ALL('Table'))
RETURN
CALCULATE (
    DIVIDE ( SUMX(VALUES('Table'[Login name]),[Report Views]), Total_View ),
    FILTER (
        ALL ( 'Table'[Login name] ),
        'Table'[Login name] &amp;lt;= MAX ( 'Table'[Login name] )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;For further details，please find attachment.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Yulia Yan&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 03:12:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-accumulated-percentage/m-p/3712872#M144470</guid>
      <dc:creator>v-weiyan1-msft</dc:creator>
      <dc:date>2024-02-21T03:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate accumulated percentage</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-accumulated-percentage/m-p/3713624#M144509</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="652678" data-lia-user-login="v-weiyan1-msft" class="lia-mention lia-mention-user"&gt;v-weiyan1-msft&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your calculation is not giving me the correct result, maybe it's because the visual is order by Report views and not Logon name.&lt;BR /&gt;But this calulation (almost) works:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Accum % Logons = 
IF( ISINSCOPE( FT_PBI_ActivityLog[Logon name] ),
VAR CurrentRank = 
    [Report View Rank By Logon]
VAR RankAndViews =
    ADDCOLUMNS(
        ALLSELECTED(FT_PBI_ActivityLog[Logon name]),
        "@Ranking", [Report View Rank By Logon],
        "@Views", [Report Views]
    )
VAR MoreViews =
    FILTER(RankAndViews,
        [@Ranking] &amp;lt;= CurrentRank
    )
VAR Result =
    SUMX(MoreViews, [@Views])
RETURN DIVIDE(Result,CALCULATE(COUNT(FT_PBI_ActivityLog[ReportName]),REMOVEFILTERS(FT_PBI_ActivityLog[Logon name])))    
)&lt;/LI-CODE&gt;&lt;P&gt;Except when 2 or more Logon name have the same no of Report views&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Lotte&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 08:46:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-calculate-accumulated-percentage/m-p/3713624#M144509</guid>
      <dc:creator>LotteLaugesen</dc:creator>
      <dc:date>2024-02-21T08:46:26Z</dc:date>
    </item>
  </channel>
</rss>

