Forum Discussion

kylesmyle's avatar
kylesmyle
Frequent Visitor
3 years ago
Solved

Group Two Products

I'm just looking to combine/group Product A and F. This would then give me a new product with their combined values. Is this possible?

  • kylesmyle you need to add a new column and then use that on the row:

     

    New Product Column = 
    IF ( Table[Product] IN { "Product A", "Product F" }, "Product A & F", Table[Product] )

5 Replies

  • kylesmyle glad it worked. Keep in mind it is always good to add a column (if possible) in PQ. FYI. 

  • kylesmyle you need to add a new column and then use that on the row:

     

    New Product Column = 
    IF ( Table[Product] IN { "Product A", "Product F" }, "Product A & F", Table[Product] )
  • kylesmyle oh! You are adding a column in the PQ, the solution I was provided was based on adding a calculated column using DAX. If you need an M code then do this:

     

    if [Product] = "Product A" or [Product] = "Product F" then "Product A & F" else [Product]

     

     

     

    • kylesmyle's avatar
      kylesmyle
      Frequent Visitor

      I see what what meant before. That actually worked better using DAX. I am brand new to PBI so I didn't know the difference between DAX and PQ, but now I do, thanks!