Forum Discussion

harib's avatar
harib
Icon for Post Patron rankPost Patron
7 years ago
Solved

Define Categories

Hi I have a Department column with diffrent sections. i would like to know the Ratio of attendence of the employees. Ex : Lets take Department (Administration) I have created measures and calc...
  • v-jiascu-msft's avatar
    7 years ago

    Hi Hari,

     

    I created a solution based on your sample data. Please don't share anything confidential here.

    Please download the demo from the attachment. 

    Measure =
    VAR tempTable =
        SUMMARIZE (
            Attendence,
            Attendence[Department],
            'Calendar'[Year],
            'Calendar'[Month],
            "ratio", [Compliance Ratio]
        )
    RETURN
        SWITCH (
            MIN ( Categories[Name] ),
            "Mild", COUNTROWS ( FILTER ( tempTable, [ratio] < 0.15 ) ),
            "Major", COUNTROWS ( FILTER ( tempTable, [ratio] >= 0.15 && [ratio] <= 0.3 ) ),
            "Chronic", COUNTROWS ( FILTER ( tempTable, [ratio] > 0.3 ) )
        )
    

    Define-Categories

     

    Best Regards,