Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KelliKnitsAlot
Helper II
Helper II

Sending an Email from Power BI Service with Formatting

I am creating a DAX column to provide specific body text in an email. (see below) I would like to get breaks in the email body, but everything I have tried does not work. Does DAX have a function to add a line break in text? 

 

Send Email =
"mailto:" & 'Laptop Returns'[Customer Email] &
"?cc= Servicedeskticket@abc.gov" &
"&subject=Service Request # " & 'Laptop Returns'[IncidentID] & " Return of Old Laptop" &
if('Laptop Returns'[Days] >= 26, "&body=Your new laptop (asset tag " & 'Laptop Returns'[New Asset Number] & " was shipped on " & 'Laptop Returns'[Deployed Date] & ". <p>
You have missed the deadline " & 'Laptop Returns'[DueDate] & " to return your old laptop "& 'Laptop Returns'[Old Asset Number] &". <p>
Your network account will be disabled shortly, and you will not be re-enabled until this laptop arrives at HQ or your manager gives us approval to re-enable your account. Please contact the Servicedeskticket@abc.gov at xxx-xxx-xxxx with questions or concerns.", "")
1 ACCEPTED SOLUTION

Thanks - that works great in desktop. But in the email body this is what I get. I don't think there is a way to format the email body with DAX. And we no longer need this solution - but I do really appreciate the community trying to help! 

 forum.jpg

 

View solution in original post

4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Please try this:

Measure = 
var break_ = "
"
return "test"&break_&"test"&break_&"abcd"

Vlianlmsft_0-1627457018913.png

Try  pressing Alt-Enter between the double quotation marks.

Thanks - that works great in desktop. But in the email body this is what I get. I don't think there is a way to format the email body with DAX. And we no longer need this solution - but I do really appreciate the community trying to help! 

 forum.jpg

 

selimovd
Super User
Super User

Hey @KelliKnitsAlot ,

 

did you try to make new lines with Shift + Enter:

my Text = "Hello,

this is a new line!

It will continues in the new line after pressing Shift + Enter

Best regards
DAX"

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

I can add new lines in DAX using shift + enter, but when I tried to add that to the DAX (see below), there are no line breaks in the email body. I am not sure I can get formatting in the body of the email. Also tried &UNICHAR(10)& with no success. 

 

Send Email =
"mailto:" & 'Laptop Returns'[Customer Email] &
"?cc= Servicedeskticket@abc.gov" &
"&subject=Service Request # " & 'Laptop Returns'[IncidentID] & " Return of Old Laptop" &
IF('Laptop Returns'[Days] >= 28, "&body=Your new laptop (Asset Number " & 'Laptop Returns'[New Asset Number] & ") was shipped on " & 'Laptop Returns'[Deployed Date] & ". "
& "{insert SHIFT-ENTER here}"&
"You have missed the deadline of " & 'Laptop Returns'[DueDate] & " to return your old laptop (Asset Number "& 'Laptop Returns'[Old Asset Number] &") .
Your network account will be disabled shortly, and you will not be re-enabled until this laptop arrives at HQ or your AIG gives us approval to re-enable your account. Please contact the Servicedeskticket@abc.gov at xxx-xxx-xxxx with questions or concerns.","")

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.