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
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])
        )

 

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 

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])
        )

 

@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
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.