Forum Discussion

JellyFish310's avatar
JellyFish310
Frequent Visitor
7 months ago
Solved

Visual "Matrix" with data in cells

Looking for some help. I have data that looks like this:

GroupOrgCriteriaStatus
Group 1Team 1101R
Group 1Team 1102Y
Group 1Team 2103G
Group 1Team 3104G
Group 2Team 4105G
Group 2Team 4106Y
Group 2Team 4107R
Group 2Team 4108G
Group 2Team 5109R
Group 2Team 5110C
Group 3Team 6111Y
Group 3Team 7112R
Group 3Team 8113G

 

With that data i'm trying to make a visual that looks like a "matrix" but shows different number of "columns" - the number of Criteria for each Group/Team combination. Something like this:

 

GroupOrg    
Group 1Team 1101102  
Group 1Team 2103   
Group 1Team 3104   
Group 2Team 4105106107108
Group 2Team 5109110  
Group 3Team 6111   
Group 3Team 7112   
Group 3Team 8113   

 

In this case, the full columns are irelevent, but there are "different" numbers of "columns" for each row depending on the number of Criteira for each Team/Group combination.

 

Also, the indivial cells (the Criteria Numbers) should be conditional formatted based on the Status value.

 

Anyone have any thoughts on how to accomplish this in one visual, which could be filtered using a slicer?

  • Hi JellyFish310 

     

    Add a column that ranks your criteria within their own group and org. Add another column to repeat an invisible character based on those rank numbers - this will be used as the column header.

    Index Within Group Org = 
    RANKX (
        FILTER (
            'Table',
            'Table'[Group] = EARLIER ( 'Table'[Group] )
                && 'Table'[Org] = EARLIER ( 'Table'[Org] )
        ),
        'Table'[Criteria],
        ,
        ASC,
        DENSE
    )
    
    ------------------
    
    Invisible Index = 
    REPT ( UNICHAR ( 8203 ), 'Table'[Index Within Group Org] )
    

     

     

    Please see the attached pbix.

  • danextian's avatar
    danextian
    7 months ago

    the index/rank approach will put the criteria into individual cells. there is a pbix attached in my first response.

10 Replies

  • Hii JellyFish310 

     

    Power BI does not support a matrix with a variable number of columns per row.The recommended approach is to keep the data in long format and use a Table visual with a DAX measure that concatenates criteria horizontally per Group/Team. Conditional formatting can be embedded in the measure (or via SVG) to reflect status. This solution works with slicers and avoids unsupported matrix behavior.

    • JellyFish310's avatar
      JellyFish310
      Frequent Visitor

      Thanks, that's what I was expecting.


      I know how to concatenate the data in a measure, do have any resources on how to conditional format within that measure (the non-SVG way)?

  • For matrix visuals, The column structure is generaly fixed.

    The other way to handle this is by creating a dynamic index or rank for Criteria within each Group and Team. This index should update automatically whenever the data refreshes.You then use this index as the matrix column. 

  • Hi JellyFish310 

     

    Add a column that ranks your criteria within their own group and org. Add another column to repeat an invisible character based on those rank numbers - this will be used as the column header.

    Index Within Group Org = 
    RANKX (
        FILTER (
            'Table',
            'Table'[Group] = EARLIER ( 'Table'[Group] )
                && 'Table'[Org] = EARLIER ( 'Table'[Org] )
        ),
        'Table'[Criteria],
        ,
        ASC,
        DENSE
    )
    
    ------------------
    
    Invisible Index = 
    REPT ( UNICHAR ( 8203 ), 'Table'[Index Within Group Org] )
    

     

     

    Please see the attached pbix.

    • danextian's avatar
      danextian
      Super User

      Another approach is to simply concatenate your criteria

      Concatenated criteria = 
      CONCATENATEX (
          'Table',
          'Table'[Criteria],
          " ",
          CALCULATE ( SELECTEDVALUE ( 'Table'[Criteria] ) )
      )
      

       

      • JellyFish310's avatar
        JellyFish310
        Frequent Visitor

        Thanks for your response. I understand how to do a simple concatenation to list the "criteria numbers" in one measure.

         

        The kicker is that i absolutely need the conditional formatting (preferably the background) based on the "Criteria Status."

         

        I doubt with the concat, or rank, method this is possible?

  • Hi JellyFish310 

    May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.


    Thank you