Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hi All,
I have a great little measure in a Power BI report that drafts a booking email based on the users choices. The measure works fine, but I am having diffculty getting it to format the email correctly. Most notably, formatting blank lines into the email between text. I have tried several DAX commands with no luck.
This is the current DAX code (Wherever there is UNICHAR(10) should be a blank line between text) -
I (Enter name) would like apply to attend: Cardio-Pulmonary Resuscitation -CPR Training on 2024-02-07 at 0730Need some help?Learning and Development will confirm your preferred date via an iCal Microsoft notification. If we are unable to offer you your selected date, one of the Learning and Development team members will contact you to discuss.Be sure to check your training bookings via the HR044 Training Compliance Report to ensure you remain compliant.Need some help? Please contact L.........
Does anyone know how to format this email in DAX to include the line breaks?
Thankyou in advance
Solved! Go to Solution.
Thanks for your help Team,
I have solved this with help from a collegue. To keep the formatting with line breaks from PBI to Outlook email, I had to add %0a to the front of the text were the new line should start. See below -
Thanks for your help Team,
I have solved this with help from a collegue. To keep the formatting with line breaks from PBI to Outlook email, I had to add %0a to the front of the text were the new line should start. See below -
That means you don't need any of the UNICHAR pieces.
Hi @Disaster110 ,
UNICHAR(13) corresponds to the carriage return character (also known as newline or line feed). It is used to move the cursor to the beginning of the next line in a text document.
Below is the revised DAX:
Email Link =
"mailto:emailaddress" &
"?subject=" & "Training booking request" & " " & 'Available Courses'[Course Name] & " " & 'Available Courses'[Commenced] &
"&body=" &
"I (Enter name) would like apply to attend: " & " " & 'Available Courses'[Course Name] & " " &
"Training " & " " & "on" & " " & 'Available Courses'[Commenced] & " " & "at " & " " & 'Available Courses'[Start Time]&
UNICHAR(13) & UNICHAR(10) &
UNICHAR(13) & UNICHAR(10) &
"Need some help?" &
UNICHAR(13) & UNICHAR(10) &
"Learning and Development will confirm your preferred date via an iCal Microsoft notification. If we are unable to offer you your selected date, one of the Learning and Development team members will contact you to discuss." &
UNICHAR(13) & UNICHAR(10) &
UNICHAR(13) & UNICHAR(10) &
"Be sure to check your training bookings via the HR044 Training Compliance Report to ensure you remain compliant." &
UNICHAR(13) & UNICHAR(10) &
UNICHAR(13) & UNICHAR(10) &
"Need some help? Please contact L&D Support on 00 000 000 00." &
UNICHAR(13) & UNICHAR(10) &
"L&D Support"
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thankyou @Anonymous
This works well in PBI and returns the desired result -
However, once it cuts a draft email in Outlook, it reverts back to this -
I (Enter name) would like apply to attend: Cardio-Pulmonary Resuscitation -CPR Training on 2024-02-07 at 0730Need some help?Learning and Development will confirm your preferred date via an iCal Microsoft notification. If we are unable to offer you your selected date, one of the Learning and Development team members will contact you to discuss.Be sure to check your training bookings via the HR044 Training Compliance Report to ensure you remain compliant.Need some help? Please contact L
So I am thinking this must be an outlook issue.
Appreciate your help.
try "<BR>" instead.
Thanks @lbendlin, I tried that one -
Still comes back like this in the email -
I (Enter name) would like apply to attend: Cardio-Pulmonary Resuscitation -CPR Training on 2024-02-07 at 0730<BR>This text on next line
Maybee it is an Outlook thing unrelated to PBI??