Forum Discussion

mysasai's avatar
mysasai
Frequent Visitor
1 year ago
Solved

Matrix Visual Should show one row rather than summing next levels

Hi all,

 

I have a situation and I'm assuming it is not possible with straight forward functionalities of PBI. 

Please help me in solving this. 

I have a data source, something like below. 

 

GroupLEVEL1LEVEL2LEVEL3LEVEL4Value
XYZGlobal   8
XYZGlobalAPAC  8
XYZGlobalAPACENT 3
XYZGlobalAPACENTIHE0
XYZGlobalAPACENTM&E13
XYZGlobalAPACENTM&E20
XYZGlobalAPACENTM&E36
XYZGlobalAPACIMS 14
XYZGlobalAPACIMSIMS114
XYZGlobalAPACIMSIMS220
XYZGlobalAPACIMSIMS30
XYZGlobalAPACIMSIMS46
XYZGlobalAPACMED 0
XYZGlobalAPACMEDADV0
XYZGlobalAPACMEDBCS0
XYZGlobalAPACMEDCAS0
XYZGlobalAPACMEDPUB0
XYZGlobalNA  0
XYZGlobalNADTS 0
XYZGlobalNADTSITS0
XYZGlobalNAWTS 0
XYZGlobalNAWTSWTS20
ABCGlobal   4
ABCGlobalAPAC  4
ABCGlobalAPACENT 2
ABCGlobalAPACENTIHE0
ABCGlobalAPACENTM&E12
ABCGlobalAPACENTM&E20
ABCGlobalAPACENTM&E33
ABCGlobalAPACIMS 7
ABCGlobalAPACIMSIMS17
ABCGlobalAPACIMSIMS210
ABCGlobalAPACIMSIMS30
ABCGlobalAPACIMSIMS43
ABCGlobalAPACMED 0
ABCGlobalAPACMEDADV0
ABCGlobalAPACMEDBCS0
ABCGlobalAPACMEDCAS0
ABCGlobalAPACMEDPUB0
ABCGlobalNA  0
ABCGlobalNADTS 0
ABCGlobalNADTSITS0
ABCGlobalNAWTS 0
ABCGlobalNAWTSWTS20

 

I have dragged them into Matrix Visual like this.

 

 

Currently it shows like the screenshot below. 

 

I don't want to show the blank rows coming up in between and also don't want to show totals summed. 

 

I would want to see like below.

 

Thanks in advance for helping. 

 

amitchandak Greg_Deckler Icey 

  • Hi mysasai 

     

    you can write a measure as follows:

     

    Measure 2 = if (SELECTEDVALUE(My_Table[LEVEL4]) <> blank () , max(My_Table[Value]) , if (SELECTEDVALUE(My_Table[LEVEL3]) <> BLANK() , maxx(filter(My_Table,My_Table[LEVEL4]=blank()) , My_Table[Value]) , if (SELECTEDVALUE(My_Table[LEVEL2]) <> blank() , maxx(filter(My_Table,My_Table[LEVEL3]=blank()) , My_Table[Value]) , if (SELECTEDVALUE(My_Table[LEVEL1]) <> blank() , maxx(filter(My_Table,My_Table[LEVEL2]=blank()) , My_Table[Value]) ,blank()))))
     
    and add it to values of your matrix.
     
    If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.
  • mysasai 

     

    then it would be better to update your measure as follows: 

     

    Measure= if (ISINSCOPE(My_Table[LEVEL4]) , max(My_Table[Value]), if (ISINSCOPE(My_Table[LEVEL3]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) && My_Table[LEVEL1]=SELECTEDVALUE(My_Table[LEVEL1]) && My_Table[LEVEL2]=SELECTEDVALUE(My_Table[LEVEL2]) && My_Table[LEVEL3]=SELECTEDVALUE(My_Table[LEVEL3]) && My_Table[LEVEL4] = blank()),My_Table[Value]) , if (ISINSCOPE(My_Table[LEVEL2]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) && My_Table[LEVEL1]=SELECTEDVALUE(My_Table[LEVEL1]) && My_Table[LEVEL2]=SELECTEDVALUE(My_Table[LEVEL2]) && My_Table[LEVEL3] = blank()),My_Table[Value]) , if (ISINSCOPE(My_Table[LEVEL1]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) && My_Table[LEVEL1]=SELECTEDVALUE(My_Table[LEVEL1]) && My_Table[LEVEL2] = blank()),My_Table[Value]) , if (ISINSCOPE(My_Table[Group]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) &&  My_Table[LEVEL1] = blank()),My_Table[Value]))))))
     
    and easily can filter blank in the filter pane of matrix visual as follows"

     

     
    do the same for each level. if any Q feel free to ask.
     
    If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.

4 Replies

  • Hi mysasai 

     

    you can write a measure as follows:

     

    Measure 2 = if (SELECTEDVALUE(My_Table[LEVEL4]) <> blank () , max(My_Table[Value]) , if (SELECTEDVALUE(My_Table[LEVEL3]) <> BLANK() , maxx(filter(My_Table,My_Table[LEVEL4]=blank()) , My_Table[Value]) , if (SELECTEDVALUE(My_Table[LEVEL2]) <> blank() , maxx(filter(My_Table,My_Table[LEVEL3]=blank()) , My_Table[Value]) , if (SELECTEDVALUE(My_Table[LEVEL1]) <> blank() , maxx(filter(My_Table,My_Table[LEVEL2]=blank()) , My_Table[Value]) ,blank()))))
     
    and add it to values of your matrix.
     
    If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.
    • mysasai's avatar
      mysasai
      Frequent Visitor

      Thank you Selva-Salimi, this worked and values are not suming up.

       

      Any idea how would I hide blank rows highlighted in Red lines in screenshot. 

       

      • Selva-Salimi's avatar
        Selva-Salimi
        Icon for Solution Sage rankSolution Sage

        mysasai 

         

        then it would be better to update your measure as follows: 

         

        Measure= if (ISINSCOPE(My_Table[LEVEL4]) , max(My_Table[Value]), if (ISINSCOPE(My_Table[LEVEL3]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) && My_Table[LEVEL1]=SELECTEDVALUE(My_Table[LEVEL1]) && My_Table[LEVEL2]=SELECTEDVALUE(My_Table[LEVEL2]) && My_Table[LEVEL3]=SELECTEDVALUE(My_Table[LEVEL3]) && My_Table[LEVEL4] = blank()),My_Table[Value]) , if (ISINSCOPE(My_Table[LEVEL2]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) && My_Table[LEVEL1]=SELECTEDVALUE(My_Table[LEVEL1]) && My_Table[LEVEL2]=SELECTEDVALUE(My_Table[LEVEL2]) && My_Table[LEVEL3] = blank()),My_Table[Value]) , if (ISINSCOPE(My_Table[LEVEL1]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) && My_Table[LEVEL1]=SELECTEDVALUE(My_Table[LEVEL1]) && My_Table[LEVEL2] = blank()),My_Table[Value]) , if (ISINSCOPE(My_Table[Group]) , maxx(FILTER(ALL(My_Table) ,My_Table[Group]=SELECTEDVALUE(My_Table[Group]) &&  My_Table[LEVEL1] = blank()),My_Table[Value]))))))
         
        and easily can filter blank in the filter pane of matrix visual as follows"

         

         
        do the same for each level. if any Q feel free to ask.
         
        If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.