cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dacoil New Member
New Member

Looking for a PowerBI Dax solution - rolling cumulative transaction based, not time

Hey looking for a way to sum a column by limiting the sum (of Flags) to the current and previous 3 rows.  These events have date time stamps, but the time delta between the transactions is not exact to do a rolling cumulative by a datesbetwen function.  And specifically we only want the past 4 transactions to be counted.

 

DTS   Value   Flag   RollingFlagCount

12:21  5.5         1               1

12:22  6.0         0               1

12:30  6.2         1               2

12:33  6.3         1               3

12:35  3            0               2

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Looking for a PowerBI Dax solution - rolling cumulative transaction based, not time

Hi @dacoil,

 

You can use below formula to get the grouping rolling count.

 

Sample measure:

 

RollingCount = COUNTX(FILTER(ALL(test),[DTS]<=MAX(test[DTS])&&[Flag]=MAX(test[Flag])),[Flag])

Capture.PNG

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
1 REPLY 1
Community Support Team
Community Support Team

Re: Looking for a PowerBI Dax solution - rolling cumulative transaction based, not time

Hi @dacoil,

 

You can use below formula to get the grouping rolling count.

 

Sample measure:

 

RollingCount = COUNTX(FILTER(ALL(test),[DTS]<=MAX(test[DTS])&&[Flag]=MAX(test[Flag])),[Flag])

Capture.PNG

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 125 members 1,377 guests
Please welcome our newest community members: