Forum Discussion

SoufTC's avatar
SoufTC
Helper I
4 years ago
Solved

Subtotals in Matrix with Hierarchy not adding up

I’m having trouble to sum totals of subcategory   I have two tables. 1. A table that defines unique FaceBook pages names (repository)[Page] and the name of the person responsible for the page(repo...
  • v-angzheng-msft's avatar
    v-angzheng-msft
    4 years ago

    Hi, SoufTC 

    Try measures as follows:

    Likes Rank = 
    var _t=FIlter(ALL('repository'),[Last Likes]<>BLANK())
    var _rank=
    RANKX(_t,
        CALCULATE([Last Likes]),,ASC,Dense)
        return IF([Last Likes]<>BLANK()&&HASONEVALUE(repository[Page]),_rank)
    Followers Rank = 
    var _t=FIlter(ALL('repository'),[Last Followers]<>BLANK())
    var _rank=
    RANKX(_t,
        CALCULATE([Last Followers]),,ASC,Dense)
        return IF([Last Followers]<>BLANK()&&HASONEVALUE(repository[Page]),_rank)
    COMMUNITY = 
    SUMX(ADDCOLUMNS('repository',"_last rank",[Likes Rank],"_followers rank",[Followers Rank]),DIVIDE([_last rank]+[_followers rank],2))

    Result:

    Please refer to the attachment below for details.

    Hope this helps.

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng

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