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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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