Search code examples
excelpowerbipowerquerytextjoin

TEXTJOIN (IF statement - Array) in Power BI


I have a data for which I used TEXTJOIN in excel to achieve the result.


The function looks like :

=TEXTJOIN("/", TRUE, IF([id]=[@[id]], [likes], ""))


How can I achieve this in Power BI?

In Excel, I converted my data to Table and then hit CTRL + SHIFT + ENTER (as it's array) to get my results.


Solution

  • You could add a Calculated Column to your table with the following formula:

    =
    VAR ThisID = 'Table'[id]
    RETURN
        CONCATENATEX(
            FILTER(
                'Table',
                'Table'[id] = ThisID
            ),
            'Table'[likes],
            "/"
        )