Forum Discussion

timward10's avatar
timward10
Helper II
1 year ago
Solved

Return multiple values

Hi,    I have two tables that I am using from Salesforce objects.    Table 1 = Opportunties Table 2 = Opportuntiy products   Table 1 is all of the opportunties available, and Table 2 shows any...
  • Sahir_Maharaj's avatar
    1 year ago

    Hello timward10,

     

    Can you please try this approach to display all products as a single concatenated string:

    OpportunityProductsList = 
    VAR Products = 
        CONCATENATEX(
            RELATEDTABLE('Opportunity Products'),
            'Opportunity Products'[Product Name],
            ", " -- Separator
        )
    RETURN 
        IF(ISBLANK(Products), "No Products", Products)
    
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi ,

    Based on the information, try using the following DAX formula to split products column across three lines or using power query editor to transform the column.

    OpportunityProductsExpanded =
       GENERATE(
        Opportunities,
        IF(
         COUNTROWS( RELATEDTABLE('Opportunity Products') ) > 0,
          SELECTCOLUMNS(
           RELATEDTABLE('Opportunity Products'),
           "OpportunityID", [Opportunity ID],
           "Product", [Product Name]
          ),
         ROW("OpportunityID", Opportunities[Opportunity ID], "Product", "No Products")
        )
       )

    GENERATE 函数(DAX) - DAX | Microsoft Learn

     

    Best Regards,

    Wisdom Wu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.