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
redhughes
Helper II
Helper II

Starters/leavers - cumulative

Hi,

 

My data set looks similar to this:

Capture2.PNG

 

 

 

 

 

 

This means I can quite easily show starters and leavers per month (both in terms of headcount and hours), and therefore net change. However, I am now thinking of a way to show a cumulative over time, i.e.:

  • on 1/1/18 it'd be 1 (or 40)
  • on 2/1/18 it'd show 2 (77.5)
  • on 3/1/18 it'd show 3 (117.5) and finally
  • on 4/1/18 it'd shows 2 (77.5) again

Any tips on how to model it? What formulas/tables/columns should I be creating? Thanks for all suggestions!

1 ACCEPTED SOLUTION

Hi @redhughes,

 

You can try to use following measure, I added new conditions on leave date to prevent dax formula calculated on leave employees.

Measure =
CALCULATE (
    SUM ( 'Table'[Hours] ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Start Date] <= MAX ( 'Table'[Start Date] )
            && OR ( [Leave date] = BLANK (), [Leave date] >= MAX ( Table[Start Date] ) )
    )
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
themistoklis
Community Champion
Community Champion

@redhughes

 

You can use a formula like the following one:

Cumulative = 
CALCULATE (
    SUM ( 'Table'[Hours] ),
    FILTER( ALL ('Table' ),
    'Table'[Start Date] <= MAX( 'Table'[Start Date] ))
)

See also workspace on this link

thanks @themistoklis, unfortunately this measure doesn't take into account leavers so it keeps adding hours on and on disregarding the fact that someone might have left (and would therefore reduce the number of cumulative hours)

Hi @redhughes,

 

You can try to use following measure, I added new conditions on leave date to prevent dax formula calculated on leave employees.

Measure =
CALCULATE (
    SUM ( 'Table'[Hours] ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Start Date] <= MAX ( 'Table'[Start Date] )
            && OR ( [Leave date] = BLANK (), [Leave date] >= MAX ( Table[Start Date] ) )
    )
)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help 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.