Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to add line breaks in a string of text in Microsoft's DAX language?

I have a DAX function that pulls in multiple strings of text (from multiple columns) into one cell. But on display I want to have a line break in between the header and the body of the paragraph. Is there a way to code in a line break with DAX? FYI, I'm using Power BI for this. Thanks!

like image 449
jschlereth Avatar asked Mar 10 '16 15:03

jschlereth


2 Answers

In BI Desktop, just type alt-enter in your DAX formula to add new line For example:

CONCATENATEX(Project, ProjectName & ":" & [some-measure], 
//new line in parameter delimiter
",
"
)
like image 77
nguyen giang Avatar answered May 23 '23 22:05

nguyen giang


Using DAX String = [field A] & UNICHAR(10) & [field B]

Example: Field A contains text: January 11, 2018 Field B contains text: Happy Birthday Elvis

This will return:

January 11, 2018

Happy Birthday Elvis

like image 21
Beth Hall Avatar answered May 23 '23 21:05

Beth Hall