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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
MURTAZA
Resolver I
Resolver I

CONCATENATE DISTINCT VALUES in Tooltip

Hi All,

I am trying to create a custom tooltip for a table and matrix visual.
My table is like this. 

DepartmentEmployeePercentage
Dept-AEmp-150%
Dept-AEmp-2100%
Dept-AEmp-3100%
Dept-AEmp-4100%
Dept-BEmp-5100%
Dept-BEmp-6100%
Dept-BEmp-150%
Dept-BEmp-7100%
Dept-BEmp-8100%
Dept-BEmp-9100%
Dept-BEmp-10100%


I want to create a measure for the tooltip to display distinct values of percentages, separated by a ",". So it should show "Percentage = 50%,50%", when I hover over the first row and in the second row "Percentage = 100%".
I wrote this DAX but it didn't work:

Percentage Tooltip =
CALCULATE(
CONCATENATEX(
DISTINCT(Percentage)
,","
),
FILTER(ALL(Table),'Table'[Employee] = SELECTEDVALUE('Table'[Employee])
)
)

 

1 ACCEPTED SOLUTION

@MURTAZA , both values are .5 

 

You can try like 

Tooltip = 
CALCULATE(
CONCATENATEX(
        SUMMARIZE(Sheet1,Sheet1[Employee],
        Sheet1[Percentage]),[Percentage]
        ),
        ALLEXCEPT(Sheet1,Sheet1[Employee])
        )

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@MURTAZA , Try a measure like

 

CONCATENATEX(summarize(Table,Employee[employee], Table[Percentage]),Table[Percentage],",")

 

Assumed Percentage is a column 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

Thank you for the response, but it is not working.

MURTAZA_1-1614965939500.png

I have created a sample .pbix file attached, if you could look into it, please. Thanks

https://drive.google.com/file/d/1klhlx03gz55ti99xCygZUUve9QOj0u6p/view?usp=sharing

@MURTAZA , both values are .5 

 

You can try like 

Tooltip = 
CALCULATE(
CONCATENATEX(
        SUMMARIZE(Sheet1,Sheet1[Employee],
        Sheet1[Percentage]),[Percentage]
        ),
        ALLEXCEPT(Sheet1,Sheet1[Employee])
        )

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

My apologies that I forgot to mention 1 important aspect of my data is that I have created a unique ID column that I am using, instead of the employee ID (this is because of the limitation Matrix visual has of aggregating data. The duplicated employee IDs, within a department, were aggregated to show as 1, so I had to create a unique ID. This formula is not working in this scenario now, which is understandable, as it is unable to find distinct values. Can you help and advise on this please?

MURTAZA_0-1614970166539.png

 

MURTAZA_1-1614970191626.png

 

 

Tooltip =

CALCULATE(

CONCATENATEX(

 SUMMARIZE(

 Sheet1,

 Sheet1[Unique ID],

 Sheet1[Percentage]

 ),

 [Percentage]

 ,", "),

 ALLEXCEPT(Sheet1,Sheet1[Unique ID]

 ) )

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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