Hi,
I have 1500 unique IDs, everyday many are seen and some multiple times a day.
I would like to do a cumulative count and know how many days does it takes to see them all 1500, once it reaches that amount, the cumulative sum needs to reset for another count until the next time the goal is met.
I've done a running total after a grouped count by date, but my issue aside from the needed reset is that the duplicates needs to be removed based on the time period needed to attain the goal. If i'm grouping my IDs by date then i'm losing the ability to sort out duplicates...
So i'm guessing I need to first find how much time is needed, then remove the duplicates from a custom column spanning over its own run tower the goal, and then, calculate the running...
Here's an ugly paint mockup of what i'd like my final result to look like (I realize I need my date format to be date.time otherwise i'll never get a correct goal and it'll be tricky)
![Kiwizqt_0-1600449194030.png Kiwizqt_0-1600449194030.png]()
I've found this solution here from Lind25 but the syntax is wrong, maybe from a previous PQ version:
https://community.powerbi.com/t5/Desktop/Running-total-that-resets-when-equal-to-or-greater-than-a-set/td-p/367214/page/2
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
AddedIndex = Table.AddIndexColumn(Source, "Index", 1, 1),
#"Added Custom" = Table.AddColumn(AddedIndex, "Running total reset", each List.Accumulate(List.FirstN(AddedIndex[Difference],[Index]),0,(state,current)=>if state+current > 60 then 0 else state+current))
in
#"Added Custom"
Any takers ? I'm completely lost on that one...
Thanks