Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
anthlen
Frequent Visitor

Calculate Running Total vs Year End Total- two different columns

Hi All,

 

Forgive me if this has been discussed before-

 

I am looking to calculate a running total of one column(Attrition) vs Year-end Total(Roster) in another column - This is for calculating employee Attrition

 

I have one DataSet- we count the employee twice if they left

RosterAttritionEmployeeEffective YearEffective Month
1 A2017January
1 B2017March
1 C2017April
 1A2017March
 1B2017April

 

I would like to calculate the following- I envision it like this so I can create a cumulative line bar chart.  I would like to use the last line.  I would also have multiple years in this.

MonthAttrtion TotalAttrition Running Total2017 Roster Year Total****bleep**** % Attrition
Jan0030%
Feb0030%
Mar11333%
Apr12367%

 

Any thoughts?

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @anthlen

 

I would suggest that evaluating one year a time with a slicer based on year. Roster_Year_Total would be easy.

Roster_Year_Total =
CALCULATE (
SUM ( 'table'[Roster] ),
ALLEXCEPT ( 'Table', 'Table'[Effective Year] )
)

Then we could get the running total of Attrition.

Running_Attrition =
CALCULATE (
    SUM ( 'table'[Attrition] ),
    FILTER (
        ALL ( 'table' ),
        'table'[effective month] <= MAX ( 'table'[effective month] )
    )
)

Finally we get the percentage.

 

% = [Running_Attrition]/[Roster_Year_Total]

Calculate Running Total vs Year End Total- two different columns.jpg

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
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

1 REPLY 1
v-jiascu-msft
Employee
Employee

Hi @anthlen

 

I would suggest that evaluating one year a time with a slicer based on year. Roster_Year_Total would be easy.

Roster_Year_Total =
CALCULATE (
SUM ( 'table'[Roster] ),
ALLEXCEPT ( 'Table', 'Table'[Effective Year] )
)

Then we could get the running total of Attrition.

Running_Attrition =
CALCULATE (
    SUM ( 'table'[Attrition] ),
    FILTER (
        ALL ( 'table' ),
        'table'[effective month] <= MAX ( 'table'[effective month] )
    )
)

Finally we get the percentage.

 

% = [Running_Attrition]/[Roster_Year_Total]

Calculate Running Total vs Year End Total- two different columns.jpg

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.