Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
My report has a list of email addresses, and the request from the users is to have a "mailto" hyperlink they can click to send an email to all addresses. The list needs to be dynamic based on slicer selections. For example, if there are six addresses in the table but the user selects a slicer to narrow the list to three addresses, the hyperlink should only display those three addresses.
What I have so far:
Email All = "mailto:" & CONCATENATEX( RELATEDTABLE(ENVH), ENVH[Email], "; ")
Produces this:
mailto: userBob@myemail.com
mailto: userJohanna@myemail.com
mailto: userTom@myemail.com
What I need to produce is this:
mailto: userBob@myemail.com; userJohanna@myemail.com; userTom@myemail.com
I originally tried this:
Email All = "mailto:" & CONCATENATEX( ENVH, ENVH[Email], "; ")
But that gives me all six addresses, and ignores my slicer selections (addresses in red should NOT be included)...
mailto: userBob@myemail.com; userJohanna@myemail.com; userTom@myemail.com; userBeth@myemail.com; userPaul@myemail.com; userGeorge@myemail.com
Solved! Go to Solution.
I was able to get what I needed by converting the calculated column into a measure.
DAX:
Email All = "mailto: " & CONCATENATEX(VALUES(ENVH[Email]),ENVH[Email],"; ")
can you make an actual button with this measure? i got it to work but it will only work in a table. I set the button to weburl and add the measure but nothing happens.
We got it to work with a button. Not sure if this applies to your situation, but "mailto" has a limit of 2,000 characters. We found the button would not function if the concatenated list was over 2,000 characters long. We used slicers so our users could break the list down into smaller, more manageable groups. This allows them to get the "mailto" under 2,000 characters, which allows the button to function.
Hmmm. I have a slicer and it still doesn't work for me even with just two email addresses
I was able to get what I needed by converting the calculated column into a measure.
DAX:
Email All = "mailto: " & CONCATENATEX(VALUES(ENVH[Email]),ENVH[Email],"; ")
The data model is a single table with no relationships. That's why I don't think RELATEDTABLE is what I should be using. There must be another way to concatenate the values after they've been sliced.
[Email All] = var __concatenatedEmails = CONCATENATEX( DISTINCT( ENVH[Email] ), ENVH[Email], "; " ) var __mailtoString = "mailto:" & __concatenatedEmails return __mailtoString
Nope, doesn't work. That gives me the exact same result as my original formula:
Original formula:
Email All = "mailto:" & CONCATENATEX( ENVH, ENVH[Email], "; ")
Here is the output when not sliced:
Here is the output when sliced:
The slicer is having no effect. When I toggle that slicer, there should only be three email addresses listed.
User | Count |
---|---|
60 | |
22 | |
18 | |
18 | |
16 |
User | Count |
---|---|
87 | |
59 | |
52 | |
38 | |
21 |