Forum Discussion

sarahhp's avatar
sarahhp
Frequent Visitor
9 years ago
Solved

Concatenate rows with filter

I don't come from a coding background but I'm trying to take a list of products associated with different companies and concatenate the products associated with each company into a single field.  My table has ~5000 products associated with ~1200 companies.  Here's my DAX statement for a measure that's not working:

 

Product List= CONCATENATEX(FILTER(Table,Table[Company Name]= [MS - Company Name]) ,(Table[Product Name],","))

 

Thanks for any pointers!

  • sarahhp

     

    Please use a Measure not a column

     

    Look at this:

     

    Product List is a Measure

11 Replies

  • dkay84_PowerBI's avatar
    dkay84_PowerBI
    Icon for Microsoft Employee rankMicrosoft Employee

    Can you please elaborate on what you are trying to accomplish?  As I understand it, you have a table with 2 columns: a products column and companies column.  The products column has ~5000 products (rows) so there are duplicates of some of the companies as some companies have multiple products.

     

    What is your end goal?  Can you post a screen shot of your data/table?

    • sarahhp's avatar
      sarahhp
      Frequent Visitor

      My end goal is to show a report with data like:

       

      Company    Product List

      Microsoft     SQL Server, Office 365

      Oracle          Crystal Ball, Developer Suite, Oracle VM

       

      From Data that looks like...

      Company    Product(s)

      Microsoft     SQL Server

      Oracle          Developer Suite

      Microsoft     Office 365

      Oracle          Cystal Ball

      Oracle          Oracle VM

       

      • Vvelarde's avatar
        Vvelarde
        Icon for Community Champion rankCommunity Champion

        sarahhp

         

        hi. Please try with this measure:

         

        Product List= CONCATENATEX(Table, (Table[Product Name],","))

         

        You can view like you want with a table visual.

         

        Adding CompanyName and Product List.