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
VinLee1314
New Member

Cumulative measures count

Hi,

 

I'm trying to get my "cumulative Leavers" column working but to no avail. "Cumulative Leavers" simply calculate a running total of the "Leavers" column. Please help!

 

VinLee1314_0-1663383835112.png

My measures are as follows:

New Hire =
    CALCULATE(
        [Count of Employees],
        USERELATIONSHIP('Calendar'[Date], 'HR Dataset'[Hire date])
    )
 
Cumulative New Hire =
CALCULATE(
    [New Hire],
    FILTER(
        ALL('HR Dataset'),
        'HR Dataset'[Hire date] <= MAX('Calendar'[Date])
    )
)
 
Leavers =
CALCULATE(
    [Count of Employees],
    USERELATIONSHIP('Calendar'[Date], 'HR Dataset'[Term date])
    ) + 0
 
Cumulative Leavers =
CALCULATE(
    [Leavers],
    USERELATIONSHIP('Calendar'[Date], 'HR Dataset'[Term date]),
    FILTER(
        ALL('HR Dataset'),
        'HR Dataset'[Term date] <=  MAX('Calendar'[Date])        
        )
)
 
My model is as follows:
VinLee1314_1-1663384031255.png

 

I suspect it's relationship-related but counldn't pin point where the issue is. Your help will be much appreciated!

 

Vin

 

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @VinLee1314 

Please try 

Cumulative Leavers =
SUMX (
FILTER (
ALLSELECTED ( 'Calendar'[Year] ),
'Calendar'[Year] <= MAX ( 'Calendar'[Year] )
),
[Leavers]
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @VinLee1314 

Please try 

Cumulative Leavers =
SUMX (
FILTER (
ALLSELECTED ( 'Calendar'[Year] ),
'Calendar'[Year] <= MAX ( 'Calendar'[Year] )
),
[Leavers]
)

Hi @tamerj1,

 

Excellent! Thanks for your help!

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.

Top Solution Authors