Forum Discussion
Convert SQL to Power BI
Hi amitchandak,
By removing one extra "," I don't have the eror anymore.
But actually, the measure gives me a number and I would like to have the actual text message in Mails[Body].
And note that for 1 Report[Racine] it might have 0-n Mails[Body]
Thx
Hi Anonymous
You can add a column in the Mails table with the following DAX codes:
UserId = DISTINCT ( FILTER ( Report, SEARCH ( Report[UserId], Mails[Body], 1, 0 ) > 0 ) )Or (if a body has multiple UserIds)
UserIds =
CONCATENATEX (
CALCULATETABLE (
VALUES ( Report[UserId] ),
FILTER ( Report, SEARCH ( Report[UserId], Mails[Body], 1, 0 ) > 0 )
),
[UserId],
","
)
Then put UserId column and Body column into a table visual.
You can also create a relationship between Report[UserId] and Mails[UserId], then you can put Report[UserId] in the table visual instead.
Reference:
SEARCH FUNCTION WITH A LIST VALUE - Microsoft Power BI Community
Kindly let me know if this helps.
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.