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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply

Creating a DAX measure to concatenate two or more course titles.

Hello,

I have a situation where I've created a very simple bar chart to display the number of courses run on a given day. So Y axis is simply 'Count of Table{course title]' and the x axis is the date. 

I want to add a tooltip for the course name. Where there is only one course, no problem, but two or more - it only displays the first/last course name. I want to create a measure that concatenates all the course names, so when I hover over a bar on my barchart, it will display all the course names. 

This is my current measure

All_Titles =
    CONCATENATEX
    (
        'TableName',
       SELECTEDVALUE
    (
        'TableName[Title]
    ),
";")
This returns the coursename for a single item or a ';' for more than one
If I use CONCATENATE it will return the coursename; for a single item or again ';' for more than one. 
 
I have thought about creating a variable and iterating through all the coursenames for a given date and appending the name to the variable, but not sure how to do this without a FOREACH function, and I don't believe this exists in DAX.
To try it, I created this measure:
 
All_Titles =
var _coursenamestring = SELECTEDVALUE('TableName'[Title])
RETURN

    CALCULATE
    (
        CONCATENATEX
        (
            'TableName',
            _coursenamestring &  ";"    
        )
    )
 No difference in result, but I didn't really expect it to. 

Can anyone help here, please? I think this should be pretty easy, but I cannot think how to do it.

Thanks alot for your help.

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

CONCATENATEX(Table,[Column],";")

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

CONCATENATEX(Table,[Column],";")

Thank you. I actually though I had tried this before the version I added above. But it works now anyway. Tks again.

johnt75
Super User
Super User

You don't need SELECTEDVALUE, that works on the filter context but inside an iterator you have a row context. Try

All_Titles =
CONCATENATEX ( VALUES ( 'TableName'[Title] ), 'TableName'[Title], ";" )

@johnt75 Thanks for replying. This didn't allow me to add the second column, unfortunately.

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.