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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
e175429
Helper IV
Helper IV

Show Values as % of Grand Total

Hello all,

 

This is my graph, seperated by fiscal year:

image001.png

 

For the data labels, instead of whole numbers i would like it to show as % of Grand Total, like this:

image002.png

 

 However, BI is summing ALL the values of the whole graph, which is 2165, to get the %'s instead of aumming the years independently, which is giving incorrect %'s.

The total for FY2021 is 66. 

The total for FY2022 is 965

FY 2023 is 1134.

 

So for "Not at all long" FY2021 should be 71%. 

FY2022 should be 63%. 

So on and so forth.

 

Attached is the data I am using.

https://docs.google.com/spreadsheets/d/1kQk0gRoMBUQ8qEpx6pfZZIm5FGLmvwfmNLqSxZeivH8/edit?usp=sharing

 

Help on steps to get what I need would be greatly appreciated!

 

Thank you!

4 ACCEPTED SOLUTIONS
Selva-Salimi
Super User
Super User

Hi @e175429 

 

you can write a measure as follows:

 

Measure =
var _resp =ALLSELECTED(Sheet1[Response])
var _perFY= calculate (count(Sheet1[Response]) , filter (ALLEXCEPT(Sheet1, Sheet1[FY]), sheet1[Response] in _resp))
return count(Sheet1[Response])/_perFY
 
If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.

View solution in original post

@e175429  - Sorry, that should be the original measure you have created, in my test file I have created this measure to define [count]

 

 

count =

COUNTROWS( Sheet1 )

 

 

So you could actually do this:

 

 

% in year = 

Var num = [count]
VAR denom = CALCULATE( [count], ALL( Sheet1[Response]))

RETURN DIVIDE( num, denom )

 

 

Basically I saying that you should create two different measures. The measure [count] is a replacement for where you are using a count of your "How long was....." column

View solution in original post

@e175429 

add the measure to y-axis! and also you can add it to tooltip

View solution in original post

@e175429 - if you only want to see the % values, you can leave it out, it will just be referenced automatically when the % measure is invoked. 

 

It's what is known as measure branching.

 

To apply my % of year measure, take out the count of your "How long was....." column and add the new measure to the Y-axis.

View solution in original post

12 REPLIES 12
mark_endicott
Super User
Super User

@e175429 - You can use the following DAX in a measure:

 

% in year = 

VAR num = COUNTROWS( Sheet1 )
VAR denom = CALCULATE( [count], ALL( Sheet1[Response]))

RETURN DIVIDE( num, denom )

 

This respects the filter of year, quarter or question, in your small multiples but for the denominator it removes the filter of Response. 

 

If this works for you, please accept it as the solution, to help for visibility for others. 

I'm not sure what this means in your measure

[count]

 

@e175429  - Sorry, that should be the original measure you have created, in my test file I have created this measure to define [count]

 

 

count =

COUNTROWS( Sheet1 )

 

 

So you could actually do this:

 

 

% in year = 

Var num = [count]
VAR denom = CALCULATE( [count], ALL( Sheet1[Response]))

RETURN DIVIDE( num, denom )

 

 

Basically I saying that you should create two different measures. The measure [count] is a replacement for where you are using a count of your "How long was....." column

Thank you very much. This worked.

@e175429 - My pleasure!

I see.

 

Where do I put that measure? How do I apply it to the graph?

@e175429 - if you only want to see the % values, you can leave it out, it will just be referenced automatically when the % measure is invoked. 

 

It's what is known as measure branching.

 

To apply my % of year measure, take out the count of your "How long was....." column and add the new measure to the Y-axis.

Selva-Salimi
Super User
Super User

Hi @e175429 

 

you can write a measure as follows:

 

Measure =
var _resp =ALLSELECTED(Sheet1[Response])
var _perFY= calculate (count(Sheet1[Response]) , filter (ALLEXCEPT(Sheet1, Sheet1[FY]), sheet1[Response] in _resp))
return count(Sheet1[Response])/_perFY
 
If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.

Thank you very much. This worked.

Hey Selva,

 

What do I do with that measure exactly?

e175429_0-1730827133703.png

 

@e175429 

add the measure to y-axis! and also you can add it to tooltip

FreemanZ
Super User
Super User

hi @e175429 ,

 

try like:

% of yearly total =

DIVIDE(

    SUM(data[value]),

    CALCULATE(

         SUM(data[value]),

         ALLEXCEPT(data, data[year])

    )

)

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.