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

Calculate Running Total based on 2 Date Columns

Hi,

 

I have a Leavers list in Table having their Month of Leaving and Month of Joining.

 * My Date table is linked to Month of Leaving.

 

I want a monthly trend / Running Total showing Sum of Leavers (who left in last 3 months and their month of joining is also in the last 3 months).

 

I am quite new to Power BI, can someone help me with the solution please?

1 ACCEPTED SOLUTION

Hi @Arunwats,

Based on my test, you could refer to below steps:

Create a date table and create relationship:

Date = CALENDARAUTO()

1.PNG

Create below calculated columns:

a = CALCULATE (
    SUM ( Table1[joiners]),
    DATESINPERIOD('Date'[Date],'Table1'[Month],-3,MONTH))
b = CALCULATE (
    SUM ( Table1[Leavers]),
    DATESINPERIOD('Date'[Date],'Table1'[Month],-3,MONTH))

Result:

1.PNG

Regards,

Daniel He

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

View solution in original post

3 REPLIES 3
v-danhe-msft
Microsoft
Microsoft

Hi @Arunwats,

Could you please offer some sample data to have a test or post your data picture if possible?

 

Regards,

Daniel He

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

Please find the sample, thanks in advance for help:

 

Sample.jpg

Hi @Arunwats,

Based on my test, you could refer to below steps:

Create a date table and create relationship:

Date = CALENDARAUTO()

1.PNG

Create below calculated columns:

a = CALCULATE (
    SUM ( Table1[joiners]),
    DATESINPERIOD('Date'[Date],'Table1'[Month],-3,MONTH))
b = CALCULATE (
    SUM ( Table1[Leavers]),
    DATESINPERIOD('Date'[Date],'Table1'[Month],-3,MONTH))

Result:

1.PNG

Regards,

Daniel He

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

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors