Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Grouping Age and Filter

Is there anyway to fix this? Or how to point where I did wrong?  Example : https://drive.google.com/file/d/1FJIKaGgkZrJHJsDoCvSMdL0YLe1-C5-N/view?usp=sharing
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

     

    Create a column.

    Column = DATEDIFF(Staff[Start Date],IF(ISBLANK(Staff[Resigned Date]),TODAY(),Staff[Resigned Date]),YEAR)

    Then create a measure.

    Measure =
    IF (
        SELECTEDVALUE ( Range[max] ) = 1,
        COUNTROWS ( FILTER ( Staff, Staff[Column] < SELECTEDVALUE ( Range[max] ) ) ),
        COUNTROWS (
            FILTER (
                Staff,
                Staff[Column] >= SELECTEDVALUE ( Range[min] )
                    && Staff[Column] <= SELECTEDVALUE ( Range[max] )
            )
        )
    )

     The final result would be shown as below.

     

    Best Regards,

    Jay

    Community Support Team _ Jay Wang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.