Forum Discussion
Return multiple values
- 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) - Anonymous1 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.
Hi Sahir_Maharaj,
Thank you, that formula works great!
Is there a way I can split that out?
For example, one opportuntiy that has three products all shows on one line. Could I split that out across three lines? So instead of the oppotunity count being one it would be three?
Thanks again!
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.