How to Display Multiple Rows in a Single Cell of a Matrix or a Table

How can I condense multiple rows into a single cell in a Matrix or a Table?

Obviously, it is easy to display all details like you see below:

But what if for every product I just want to know what countries it is selling in and what channels are used? Like how it is displayed below:

Turns out we have to write a bit of DAX but thankfully, not much at all.

Click here to download the PBIX model.

You can get the detailed explanation from my video but here are the DAX calculations that I had to create to enable this use-case.

Product Channels = 
IF(
    HASONEVALUE('Product'[Product]),
    CONCATENATEX
    (
        Channel, 
        "• " & Channel[Channel], 
        UNICHAR(10)&UNICHAR(13) , 
        Channel[Channel]
        )
)
Product Countries = 
IF(
    HASONEVALUE('Product'[Product]),
    CONCATENATEX
    (
        Country, 
        "• " & Country[Country], 
        UNICHAR(10)&UNICHAR(13) , 
        Country[Country]
        )
)

2 thoughts on “How to Display Multiple Rows in a Single Cell of a Matrix or a Table

  1. Hi, thanks for sharing, this is almost exactly what I was looking for. Except how did you git rid of the full list in the last row, the total row? I don’t necessarily need a total row, so if you could help me either getting rid of the total rows and columns or changing them somehow to the sum or empty fields, you would be a great help. Thanks a lot!!

Leave a comment