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
bipowerbix
Helper I
Helper I

Trying to CREATE percentage as tooltip when I Hover on bar graph

Here is the dataset:

Year    Type   Value

2023a20
2023b50
2023c30

 

 

Here is the Visual: I want to see percentage when hover over a category:

bipowerbix_0-1678772816394.png

 

Here is how to make the visual:

bipowerbix_1-1678772906819.png


Here is the DAX I used to make the code:

 

Measure = 
var a = sum('Table'[Value])
var b = if(HASONEVALUE('Table'[Type]), max('Table'[Value]) )
return b / a 

 

 

But the result does not show an accurate percentage when hovered:

bipowerbix_2-1678773059408.png

 

Expected result: 30/100 = 30% and not 100%

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @bipowerbix 
Please try

Measure =
DIVIDE (
    SUM ( 'Table'[Value] ),
    CALCULATE ( SUM ( 'Table'[Value] ), ALL ( 'Table'[Type] ) )
)

View solution in original post

2 REPLIES 2
aditya0125
Resolver I
Resolver I

% = DIVIDE(sum('Table'[Value]), CALCULATE(SUM('Table'[value]),all('Table'[Type])))

try this one.
 
tamerj1
Super User
Super User

Hi @bipowerbix 
Please try

Measure =
DIVIDE (
    SUM ( 'Table'[Value] ),
    CALCULATE ( SUM ( 'Table'[Value] ), ALL ( 'Table'[Type] ) )
)

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.

Top Solution Authors