Forum Discussion

BIswajit_Das's avatar
BIswajit_Das
Icon for Impactful Individual rankImpactful Individual
2 years ago
Solved

POWER BI MATRIX

Hello  If there a table like code p_no` name num area sa 1 a 1 a sa 1 b 2 b sa 1 c 3 a sa 1 d 4 a sa 1 e 5 b sa 1 f 6 a sa 1 g 7 b sa 1 ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi BIswajit_Das ,

    Sorry for being late, please change the DAX into this:

    Measure = var _tab=SUMMARIZE(ALLSELECTED('Sheet18'[RES]),'Sheet18'[RES], "@sumvalue",CALCULATE(COUNT(Sheet18[NUM])))
    var _max= maxx( _tab,[@sumvalue])
    var _area=SELECTEDVALUE('Sheet18'[RES])
    return  SWITCH(TRUE(),COUNT('Sheet18'[NUM])=_max&&_area="a","Blue", COUNT('Sheet18'[NUM])=_max&&_area= "b","Black",COUNT(Sheet18[NUM])=_max&&_area="c","Yellow")

    The final output is below:

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