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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Andy2410
Frequent Visitor

Creating Measures with a filter included

Hi

 

I am creating a dashboard for our Head of HR and she would like to see a breakdown of leavers who have less than 2 years service in increments of 18 months, 9 months, 6 months and 3 months but I am struggling to get these to work. 

 

So far I have a measure that will return the leavers in a rolling 12 months, now on the dashboard at the moment I can place this measure in a card and then apply a filter to that visual to limit it to 2 years service, but that won't work for the measures I need below that. 

Leavers rolling 12 months  =


CALCULATE(
    SUM('Reporting FactWorkForceMonthly'[NonFTELeavers]),
    DATESINPERIOD('Reporting DimDate'[Month Year],
    LASTDATE('Reporting DimDate'[Month Year]),-1,YEAR)
    )
 
As as worked example there were 53 leavers in the 12 month period that had less than 2 years service, so for the 18 months measure I want to calcuate the number of leavers out of the 53 that had less than 18 months service and so on down to 3 months.
 
Please let me know if you need further information.
 
Thank you
2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

I cannot understand your requireent.  Share some data to work with and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Bmejia
Super User
Super User

This is a different approach.  Create a new column on your employee table that calculates the months from today then just add a In between Sicer.

Months From Today = DATEDIFF(YourTable[Employment end date],TODAY(),MONTH)

The card can be dynamic based on slicer and using the months from today column or you can just create a static card which can also be edit to add separate breakouts by 3 or 6 months etc.. 
Count 3 Rolling Months = CALCULATE(Count(Query1[Name]),Query1[Months From Today]<=3

Bmejia_0-1715288503230.png

 





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors