Ranking with different granularity

@tyankata

You can try this:

Rank SQKey 2 =
IF (
    ISINSCOPE ( 'Dim Question'[Question Type] )
        && ISINSCOPE ( 'Dim Question'[Question] )
        && ISINSCOPE ( 'Fact Survey Answer'[Answer] ),
    RANKX (
        CALCULATETABLE (
            SUMMARIZE (
                'Fact Survey Answer',
                'Dim Question'[Question],
                'Dim Question'[Question Type],
                'Fact Survey Answer'[Answer]
            ),
            ALLSELECTED ( 'Fact Survey Answer' )
        ),
        [Sum SQKey],
        ,
        ASC,
        DENSE
    )
)

image

If you want to break ties then refer this:

1 Like