Forum Discussion
JB_AT
2 years agoHelper III
Dynamic Buckets
Hello I have a measure that calulates the Employee Running Total I also have a measure for Years of Service Running Total. Both work as expected. What I would like to achieve is to create a dy...
JB_AT
2 years agoHelper III
Hi Ashish_Mathur
A Sample Data is here https://docs.google.com/spreadsheets/d/1h9pr1rixp-QJk6KplPci9BcZVS6Uigju/edit?usp=sharing&ouid=105131205756781664771&rtpof=true&sd=true
I want to create Dynamic Years of Service Buckets and Count how many UniqueIds fall into those buckets. My Date Table has a relationship with the __Valid_From and __Valid_Until columns. When I change the date slicer to lets say 2022, then the Years of Service Groups change to implement this date. I created these two measures that work correctly and shows me the correct data when I use the date filter.
I want to somehow use these measures to populate the buckets, or is there another way?
Thanking you in advance
Avg.Years of Service = VAR
_MaxDate= MAX ( DIM_Date[Date] )
RETURN
CALCULATE (AVERAGEX(
'Employee History',
DATEDIFF ( 'Employee History'[__VALID_FROM], _MaxDate,DAY )/365.25
),
FILTER ( ALL ( DIM_Date ), DIM_Date[Date] <= _MaxDate )
)
Employee RT =
VAR MaxDate =
MAX ( DIM_Date[Date] )
RETURN
CALCULATE (
[Employees],
KEEPFILTERS (
'Employee History'[__VALID_FROM] <= MaxDate
&& 'Employee History'[__VALID_UNTIL] >= MaxDate
)),
ALL ( DIM_Date ), USERELATIONSHIP('Employee History'[__VALID_FROM], DIM_Date[Date]))
Ashish_Mathur
2 years agoSuper User
Hi,
Someone else will help you with this.