Forum Discussion

sanchid's avatar
sanchid
Frequent Visitor
3 years ago
Solved

Display Percentiles

Hi Community,    I have a unique problem where I need to display scores ranging from 0 to 5 which can dynamically change based on filters applied. Below is the snapshot of my source table. Based on...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi sanchid ,

    Please have a try.

    Create a table first.

    Table 2 = SUMMARIZE('Table','Table'[Industry])

    Then create a measure.

    SCORE——m =
    VAR _1 =
        SELECTEDVALUE ( 'Table 2'[Industry] )
    VAR MIN_POINTS =
        MINX ( FILTER ( ALL ( 'Table' ), 'Table'[Industry] = _1 ), 'Table'[Points] )
    VAR MAX_POINTS =
        MAXX ( FILTER ( ALL ( 'Table' ), 'Table'[Industry] = _1 ), 'Table'[Points] )
    VAR _re =
        ROUND (
            DIVIDE ( ( MAX ( 'Table'[Points] ) - MIN_POINTS ), ( MAX_POINTS - MIN_POINTS ) ) * 5,
            0
        )
    RETURN
        VAR _minvalue =
            MINX ( ALL ( 'Table' ), 'Table'[Points] )
        VAR _maxvalue =
            MAXX ( ALL ( 'Table' ), 'Table'[Points] )
        VAR _re11 =
            ROUND (
                DIVIDE ( ( MAX ( 'Table'[Points] ) - _minvalue ), ( _maxvalue - _minvalue ) ) * 5,
                0
            )
        RETURN
            IF (
                _1 = BLANK (),
                _re11,
                IF ( _1 <> BLANK () && _1 = SELECTEDVALUE ( 'Table'[Industry] ), _re, BLANK () )
            )
    

     

    How to Get Your Question Answered Quickly 

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

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