Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Matrix Visual: Substract rows, but only first category

Hi all,    my current task is to basically build a P&L in Power BI.  We get our data from excel and is basically looks like this:  In the real data we also have subsidairies, months, many o...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous 

    You can refer to the following measure

    Measure = IF(OR(MAX('Table'[Category Level 1])="Sales",ISINSCOPE('Table'[Category Level 2])),SUM('Table'[Ammount]),SUMX(FILTER(ALLSELECTED('Table'),[Category Level 1]="Sales"),[Ammount])+SUMX(FILTER(ALLSELECTED('Table'),[Category Level 1]<=MAX('Table'[Category Level 1])&&[Category Level 1]<>"Sales"),[Ammount]))

    Put the measure to the values in matrix visual

    Best Regards!

    Yolo Zhu

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