Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Showing only required rows in Matrix based on Measure Value

Hi Experts,   I need to implement one logic in Matrix visual in Power BI. As shown below, I have a matrix visual where "ITEM" and "Grade" are fields coming from columns while there is one measure c...
  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi Seward12533,

     

    I could resolve this issue by creating a calculated column to bring GRADE value in the table using Related function.

     

    I used this formula for getting it implemented using RANKX:

     

     

    Test = 
    CALCULATE (
        [MEASURE],
        FILTER (
            INVENTORY,
            NOT ( ISBLANK ( INVENTORY[GRADE] ) )
                && [MEASURE] > 0
        )
    )

     Then using RANKX:

    Rank = 
    IF (
        NOT ( ISBLANK ( [Test] ) ),
        RANKX (
            FILTER ( ALL ( INVENTORY[GRADE] ), [Test] ),
            [Test],
            ,
            ASC,
            DENSE
        ),
        BLANK ()
    )

    The issue was happening due to duplicates and blank values. It resolved the issue.