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 monthly count

Hi all,

 

Couldn't get my "Cumulative Mthly Leavers" column to work. Would appreciate your guidance, please.

 

VinLee1314_0-1663485461264.png

 

Leavers =
CALCULATE(
    [Count of Employees],
    USERELATIONSHIP('Calendar'[Date], 'HR Dataset'[Term date])
    ) + 0
 
Cumulative Mthly Leavers =
CALCULATE
(
    [Leavers],
    FILTER
    (
        ALLSELECTED ( 'Calendar'[Month] ),
        'Calendar'[Month] <= MAX ( 'Calendar'[Month] )
    )
)

 

Thanks!

Vin

1 ACCEPTED SOLUTION

Hi @VinLee1314 

you have to YearMonth number column in your date table. The try the following 

Cumulative Mthly Leavers =
CALCULATE (
[Leavers],
'Calendar'[YearMonth] <= MAX ( 'Calendar'[YearMonth] ),
ALLSELECTED ( 'Calendar' )
)

View solution in original post

4 REPLIES 4
VinLee1314
New Member

VinLee1314_0-1663495764054.png

I managed to get it working on a monthly basis. I would like the running total to continue after the year ends. How do I make changes to the DAX?

 

Cumulative Leavers =
CALCULATE
(
    [Leavers],
    FILTER
    (
        CALCULATETABLE
        (
            SUMMARIZE('Calendar', 'Calendar'[Date].[MonthNo], 'Calendar'[Date].[Month]),
            ALLSELECTED('Calendar')
        ),
        ISONORAFTER
        (
            'Calendar'[Date].[MonthNo], MAX('Calendar'[Date].[MonthNo]), DESC,
            'Calendar'[Date].[Month], MAX('Calendar'[Date].[Month]), DESC
        )
    )
)
 
Thanks!

Hi @VinLee1314 

you have to YearMonth number column in your date table. The try the following 

Cumulative Mthly Leavers =
CALCULATE (
[Leavers],
'Calendar'[YearMonth] <= MAX ( 'Calendar'[YearMonth] ),
ALLSELECTED ( 'Calendar' )
)

Hi @tamerj1 ,@daXtreme ,

 

Thank you for your help!

daXtreme
Solution Sage
Solution Sage

// # Leavers TD = count of leavers to date
[# Leavers TD] = 
var LastVisibleDate = MAX( 'Calendar'[Date] )
var Output = 
    CALCULATE(
        [# Leavers],
        'Calendar'[Date] <= LastVisibleDate,
        ALLSELECTED ( 'Calendar' )
    )
return
    Output

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