Forum

Cumulative total be...
 
Notifications
Clear all

Cumulative total before a fixed date

4 Posts
2 Users
0 Reactions
94 Views
(@lindac)
Posts: 32
Trusted Member
Topic starter
 

Hi,

Using Power BI Desktop, I want to calculate the cumulative total of sales  at the 30, 20 and 10 day mark before a fixed date called [EventDate] in 2021 and compare it against the cumulative total of sales at the 30, 20 and 10 days before the [EventDate] in 2020. Do I handle this in the date dimension or write a measure for it? If so, what is the DAX formula for this? Thank you.

Linda

 
Posted : 05/06/2021 4:06 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Linda,

Please upload a sample file in Excel (just a small sample with enough data to illustrate the scenario). Please also give an example of the desired result (also in Excel) that refers back to the data so we can follow what you mean.

Mynda

 
Posted : 05/06/2021 8:22 am
(@lindac)
Posts: 32
Trusted Member
Topic starter
 

Hi Mynda,

The desired outcome is to develop two line graphs and two corresponding tables in Power BI Desktop. The first graph/ table set will show the cumulative distinct count of event participants and the second set will show the cumulative paid amount. The tricky part is showing the cumulative patterns in 4 day intervals, from 60 days before the event date and stopping at the event date. The event date is a different date each year.

For example for the event code SUP2018, the first graph will show a distinct count of:

At the -60 day mark (18 April 2018), 2 participants who have registered (by counting the number of rows where EventRevenueType = Registration)

At the -56 day mark (22 April 2018), 3 participants who have registered

At the -52 day mark and so on until the event date.

 

While the second graph will show a cumulative paid amount of:

At the -60 day mark (18 April 2018), it will show $40

At the -56 day mark (22 April 2018), it will show $405

At the -52 day mark (26 April 2018) it will show $425

And so on until the event date.

 

Thank you Mynda

 
Posted : 06/06/2021 11:06 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Linda,

Thanks for sharing your example file. I think you might be best to generate the running total and day marks in Power Query. See file attached. I used the Grouped Running Total as explained here. And in the EventDates query I used Expand Rows technique covered in session 7.08 of the Power Query course. Hope that points you in the right direction.

Mynda

 
Posted : 08/06/2021 2:33 am
Share: