Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

% Total By Category In A Matrix

Hello!


I'm looking to get a % total by department into a matrix like below:


I've created a product count measure in Power BI, but when I try and created the % measure it calculates it as the total % for the whole table rather than by department.

 

Any help greatly appreciated.

 

Thanks!

  • Hi Anonymous ,

    According to your decription, here's my solution.

    Create a measure.

    Product Count% =
    VAR _SUM =
        SUMX (
            FILTER ( ALL ( 'Table' ), 'Table'[Department] = MAX ( 'Table'[Department] ) ),
            'Table'[Product Count]
        )
    RETURN
        IF (
            ISINSCOPE ( 'Table'[Fabric] ),
            DIVIDE ( MAX ( 'Table'[Product Count] ), _SUM ),
            1
        )
    

    Get the expected result.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

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

     

3 Replies