How to control the number of columns in a matrix

I am trying to create a heat map like in the pic below( 4 attributes in each card, with conditional formatting for background)

Is there a visalization similar to this?

I have tried creating it using table visual itself like below : (Pbi file attached)

But I just want 5- 7 columns in one row .Basically in a table visual, I am not able to control the no of columns. Everything appears in one single row.

Any solution?heat map.pbix (825.4 KB)

Hi Anu:

One possible solution would be to add calculated columns to the data in Power Query to set [Index], [Group], and [Project in Group], then add [Group] to matrix rows and [Project in Group] to matrix columns. Here’s a 5-column sample.

#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1),
#"Added Custom" = Table.AddColumn(#"Added Index", "Group", each Number.IntegerDivide([Index], 6)),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Project in Group", each [Index] - ([Group] * 5))

Hope this helps.
TEST Heat Map.pbix (818.8 KB)

1 Like

Is there any other visual I can use for this?

Hi Anu. The matrix give you the formatting options you’re problem statement described; the only other “standard” visual I can think of in Multi-card, but I don’t think it has the formatting you’re looking for. If you can use custom visuals, try those from OK Viz or those that will display small multiples (I’ve barely used custom visuals, so take with a grain of salt…). Greg


Following on @Greg’ suggestion, Matt Allington recently published a blog post about using custom visuals to create small multiples:

Here’s a link to the Zebra BI Tables visual he mentions, which I think might be worth a look:

I use the OK Viz custom visuals extensively (actually used two of them in the Enterprise DNA contest entry I submitted today) but their small multiples visual is more “card”-based ala KPIs, and I don’t think would work for your use case here though it is extremely configurable and there may be a creative way to torque it to do so:

But the Zebra table visual does look promising IMO…

  • Brian

Thanks, Cards with States worked !


That’s great (and actually a bit surprising…). Can you please post a screenshot and/or PBIX, since I’m curious how you got that to work for your requirement?


  • Brian

1 Like

To the contributor of this post. Thank you for sharing your experiences around Power BI, please don’t hesitate to add more discussion or add value to wherever you think you possess the experience or knowledge that can help others in our Ecosystem Group. You can also help us in improving the Support forum further by answering the Enterprise DNA Forum User Experience Survey. We appreciate the initiative and your help in this group!