Forum Discussion

mschutt's avatar
mschutt
Regular Visitor
4 years ago
Solved

Creating new table to pull a Min and Max value from while excluding outliers

Hello,   I am currently working on a dashboard that shows all employees, their job title, their region, and their service rate. On my dashboard I have a tile that shows Min service rate as well as ...
  • v-zhangti's avatar
    4 years ago

    Hi mschutt ,

     

    You can try the following methods.

    Measure:

    Remove two =
    VAR _highest =
        CALCULATE (
            COUNTROWS ( 'Table' ),
            FILTER (
                ALL ( 'Table' ),
                [Rate] >= SELECTEDVALUE ( 'Table'[Rate] )
                    && [Title] = "A"
                    && [Region] = "NA"
            )
        )
    VAR _lowest =
        CALCULATE (
            COUNTROWS ( 'Table' ),
            FILTER (
                ALL ( 'Table' ),
                [Rate] <= SELECTEDVALUE ( 'Table'[Rate] )
                    && [Title] = "A"
                    && [Region] = "NA"
            )
        )
    RETURN
        IF (
            _highest <= 2,
            BLANK (),
            IF ( _lowest <= 2, BLANK (), SELECTEDVALUE ( 'Table'[Rate] ) )
        )
    
    Remove one =
    VAR _highest =
        CALCULATE (
            COUNTROWS ( 'Table' ),
            FILTER (
                ALL ( 'Table' ),
                [Rate] >= SELECTEDVALUE ( 'Table'[Rate] )
                    && [Title] = "B"
                    && [Region] = "ASIA"
            )
        )
    VAR _lowest =
        CALCULATE (
            COUNTROWS ( 'Table' ),
            FILTER (
                ALL ( 'Table' ),
                [Rate] <= SELECTEDVALUE ( 'Table'[Rate] )
                    && [Title] = "B"
                    && [Region] = "ASIA"
            )
        )
    RETURN
        IF (
            _highest <= 1,
            BLANK (),
            IF ( _lowest <= 1, BLANK (), SELECTEDVALUE ( 'Table'[Rate] ) )
        )
    
    Remove Less than 10 =
    IF (
        SELECTEDVALUE ( 'Table'[Rate] ) <= 10,
        BLANK (),
        SELECTEDVALUE ( 'Table'[Rate] )
    )
    

    Table 2:

    Table 2 = 
    SUMMARIZE (
        'Table',
        'Table'[ID],
        'Table'[Name],
        'Table'[Title],
        'Table'[Region],
        "Rate",
            IF (
                SELECTEDVALUE ( 'Table'[Rate] ) = [Remove two],
                BLANK (),
                IF (
                    SELECTEDVALUE ( 'Table'[Rate] ) = [Remove one],
                    BLANK (),
                    IF (
                        SELECTEDVALUE ( 'Table'[Rate] ) = [Remove Less than 10],
                        SELECTEDVALUE ( 'Table'[Rate] )
                    )
                )
            )
    )

    Is this the result you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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