<?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: Running Total Percentage based on day in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3980609#M154355</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="572446" data-lia-user-login="Brady-Linnebur" class="lia-mention lia-mention-user"&gt;Brady-Linnebur&lt;/a&gt;&amp;nbsp; Create a measure for this a follows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RunningTotalPercentage =&lt;BR /&gt;VAR StartDay = SELECTEDVALUE('Promotions'[StartDay])&lt;BR /&gt;VAR DayIndex = WEEKDAY(StartDay, 2) // 2 = Week starts on Monday&lt;BR /&gt;VAR Days = {0.09, 0.11, 0.12, 0.13, 0.18, 0.19, 0.18}&lt;BR /&gt;VAR TotalDays = COUNTROWS(Days)&lt;BR /&gt;VAR DayList = GENERATESERIES(1, TotalDays)&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;SUMX(&lt;BR /&gt;DayList,&lt;BR /&gt;VAR CurrentIndex = DayIndex + [Value] - 1&lt;BR /&gt;VAR AdjustedIndex = IF(CurrentIndex &amp;gt; TotalDays, CurrentIndex - TotalDays, CurrentIndex)&lt;BR /&gt;RETURN Days[AdjustedIndex]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change it to your required table and column names .&lt;/P&gt;&lt;P&gt;The above calculatoin works in a way that running total will be calculated in this order, and when Wednesday hits again, it restarts from 0.12.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! This will help others on the forum!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2024 17:29:00 GMT</pubDate>
    <dc:creator>rajendraongole1</dc:creator>
    <dc:date>2024-06-07T17:29:00Z</dc:date>
    <item>
      <title>Running Total Percentage based on day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3980236#M154354</link>
      <description>&lt;P&gt;Hello I need to get a measure/calculated column that does the following.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the values:&lt;/P&gt;&lt;P&gt;Monday = .09 aka 9%&lt;/P&gt;&lt;P&gt;Tuesday = .11&lt;/P&gt;&lt;P&gt;Wednesday = .12&lt;/P&gt;&lt;P&gt;Thursday = .13&lt;/P&gt;&lt;P&gt;Friday = .18&lt;/P&gt;&lt;P&gt;Saturday = .19&lt;/P&gt;&lt;P&gt;Sunday = .18&amp;nbsp;&lt;/P&gt;&lt;P&gt;This adds up to 100%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Say I have my promotion start on a Wednesday, I need to first start on the 12%, then add 13% etc. all the way till Tuesday which would be the last 11%. Then when Wednesday hits again, I need to restart that running total. If a promotion starts on a Friday, then the first number needs to be 18% then etc until Thursday. Let me know if you need other information also. I am stuck at this point and looking for some help.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 14:47:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3980236#M154354</guid>
      <dc:creator>Brady-Linnebur</dc:creator>
      <dc:date>2024-06-07T14:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total Percentage based on day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3980609#M154355</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="572446" data-lia-user-login="Brady-Linnebur" class="lia-mention lia-mention-user"&gt;Brady-Linnebur&lt;/a&gt;&amp;nbsp; Create a measure for this a follows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RunningTotalPercentage =&lt;BR /&gt;VAR StartDay = SELECTEDVALUE('Promotions'[StartDay])&lt;BR /&gt;VAR DayIndex = WEEKDAY(StartDay, 2) // 2 = Week starts on Monday&lt;BR /&gt;VAR Days = {0.09, 0.11, 0.12, 0.13, 0.18, 0.19, 0.18}&lt;BR /&gt;VAR TotalDays = COUNTROWS(Days)&lt;BR /&gt;VAR DayList = GENERATESERIES(1, TotalDays)&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;SUMX(&lt;BR /&gt;DayList,&lt;BR /&gt;VAR CurrentIndex = DayIndex + [Value] - 1&lt;BR /&gt;VAR AdjustedIndex = IF(CurrentIndex &amp;gt; TotalDays, CurrentIndex - TotalDays, CurrentIndex)&lt;BR /&gt;RETURN Days[AdjustedIndex]&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Change it to your required table and column names .&lt;/P&gt;&lt;P&gt;The above calculatoin works in a way that running total will be calculated in this order, and when Wednesday hits again, it restarts from 0.12.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! This will help others on the forum!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000080"&gt;&lt;STRONG&gt;Appreciate your Kudos!!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 17:29:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3980609#M154355</guid>
      <dc:creator>rajendraongole1</dc:creator>
      <dc:date>2024-06-07T17:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total Percentage based on day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3980745#M154356</link>
      <description>&lt;P&gt;This did not solve my issue. This instead just repeated the number 28 constantly. I am not sure if it fully reset since I think it is totaling up all of them together.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 19:37:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3980745#M154356</guid>
      <dc:creator>Brady-Linnebur</dc:creator>
      <dc:date>2024-06-07T19:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total Percentage based on day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3982900#M154426</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="572446" data-lia-user-login="Brady-Linnebur" class="lia-mention lia-mention-user"&gt;Brady-Linnebur&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can refer to my test file to learn more details. Here I start my week on Wednesday, you can change the _SELECTSTART part in my code to change the start day.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DimDate = 
ADDCOLUMNS (
    CALENDAR ( DATE ( 2024, 01, 01 ), DATE ( 2024, 12, 31 ) ),
    "Year", YEAR ( [Date] ),
    "Month", MONTH ( [Date] ),
    "MonthName", FORMAT ( [Date], "MMMM" ),
    "WeekDay", WEEKDAY ( [Date], 2 ),
    "WeekDayName", FORMAT ( [Date], "DDDD" )
)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;FY Week Start = 
VAR _SELECTSTART = 3
RETURN
IF(DimDate[WeekDay]&amp;gt;=3, DimDate[Date] - [WeekDay] +_SELECTSTART, DimDate[Date] - [WeekDay] - _SELECTSTART - 1)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;FY WeekDay = 
VAR _SELECTSTART = 3
RETURN
IF(DimDate[WeekDay]&amp;gt;=_SELECTSTART,DimDate[WeekDay] - _SELECTSTART +1, DimDate[WeekDay] + 7 - _SELECTSTART + 1)&lt;/LI-CODE&gt;
&lt;P&gt;Measures:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FY WeekDay = 
VAR _SELECTSTART = 3
RETURN
IF(DimDate[WeekDay]&amp;gt;=_SELECTSTART,DimDate[WeekDay] - _SELECTSTART +1, DimDate[WeekDay] + 7 - _SELECTSTART + 1)&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Running Total = 
 SUMX(FILTER(ALLSELECTED(DimDate),DimDate[Date]&amp;lt;=MAX(DimDate[Date])),[Percentage])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Filter = 
IF(MAX(DimDate[Date])&amp;lt;=TODAY() &amp;amp;&amp;amp; MAX(DimDate[FY Week Start]) = CALCULATE(MAX(DimDate[FY Week Start]),FILTER(ALLSELECTED(DimDate),DimDate[Date] = TODAY())),1,0)&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;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 08:08:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3982900#M154426</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-10T08:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total Percentage based on day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3984242#M154471</link>
      <description>&lt;P&gt;Would mind explaining what the Filter calculation does? On mine they are all 0's and for your file you have it filtered to 1's. I am trying to find out why mine does not have any 1's.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 17:56:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3984242#M154471</guid>
      <dc:creator>Brady-Linnebur</dc:creator>
      <dc:date>2024-06-10T17:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Running Total Percentage based on day</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3984287#M154475</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;It also looks like it is adding up but with some issues. The far right is the running total. For this promo it is supposed to start on Saturday, but it starts adding from Monday. Also when a new week starts, it keeps adding, but I need it to start over again. The far left column is the week start, I need this to say week starting on the start date of promo, which will not always be a monday like it is showing now.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 18:42:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Running-Total-Percentage-based-on-day/m-p/3984287#M154475</guid>
      <dc:creator>Brady-Linnebur</dc:creator>
      <dc:date>2024-06-10T18:42:47Z</dc:date>
    </item>
  </channel>
</rss>

