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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
PowerBIReece
New Member

How to get % of total for filtered values

Hi Guys,

 

I am struggling to find a way to get a % of grand total for the various years for the chart below:

 

PowerBIReece_0-1656944920097.png

Essentially, I want the year totals to work out a % of the grand total for that year. However, when I use the quick measure it is giving me the the percentage of the overall grand total for all the years summed.

 

How do get the % total per years only without having to filter one year at a time?

 

Regards,

Reece

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PowerBIReece ,

I have created a simple sample, please refer to my pbix file to see it helps you.

Create a measure.

Measure =
VAR _SUBJECT =
    SELECTEDVALUE ( 'Table'[SUBJECT] )
VAR _YEAR =
    SELECTEDVALUE ( 'Table'[YEAR] )
VAR _SUMALL =
    CALCULATE (
        SUM ( 'Table'[VALUE] ),
        FILTER ( ALL ( 'Table' ), 'Table'[SUBJECT] = _SUBJECT && 'Table'[YEAR] = _YEAR )
    )
VAR _SUMYEAR =
    CALCULATE (
        SUM ( 'Table'[VALUE] ),
        FILTER ( ALL ( 'Table' ), 'Table'[YEAR] = _YEAR )
    )
RETURN
    _SUMALL / _SUMYEAR

vpollymsft_0-1657172614996.png

If I have misunderstood your meaning, please provide a simple sample and desired output like I have provided.

 

How to Get Your Question Answered Quickly 

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @PowerBIReece ,

I have created a simple sample, please refer to my pbix file to see it helps you.

Create a measure.

Measure =
VAR _SUBJECT =
    SELECTEDVALUE ( 'Table'[SUBJECT] )
VAR _YEAR =
    SELECTEDVALUE ( 'Table'[YEAR] )
VAR _SUMALL =
    CALCULATE (
        SUM ( 'Table'[VALUE] ),
        FILTER ( ALL ( 'Table' ), 'Table'[SUBJECT] = _SUBJECT && 'Table'[YEAR] = _YEAR )
    )
VAR _SUMYEAR =
    CALCULATE (
        SUM ( 'Table'[VALUE] ),
        FILTER ( ALL ( 'Table' ), 'Table'[YEAR] = _YEAR )
    )
RETURN
    _SUMALL / _SUMYEAR

vpollymsft_0-1657172614996.png

If I have misunderstood your meaning, please provide a simple sample and desired output like I have provided.

 

How to Get Your Question Answered Quickly 

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

PowerBIReece
New Member

Hi Ritesh,

I have not yet managed to resolve this.

First off, I’d like to apologize for not being able to post my PBIX file because this confidential data I am working with.

I am currently working with survey data, the questions give the respondent a few options in terms of easy, difficult etc and this is what I’m trying to plot below:

PowerBIReece_0-1657103111384.png

 

The categories are split across the different years.

PowerBIReece_1-1657103111385.png

 

 

The issue I’m having is that when I select to reflect values as a % of grand total it gives me the following output:

PowerBIReece_2-1657103111387.png

 

However, these figures are incorrect, because I am looking for a way to do this across the year, not the entire sample.

 

So for example this is the same chart filtered by only 2022:

 

PowerBIReece_3-1657103111388.png

 

These are the % figures I need to see on the chart above.

Apologies @ribisht17 

ribisht17
Super User
Super User

@PowerBIReece 

 

Kindly close the thread if the answer was useful or else let us know the challenge.

It will help the community to get to the answer directly

 

Regards,

Ritesh

ribisht17
Super User
Super User

@PowerBIReece 

 

Guess you are making use of ALL, please turn that to ALLEXCEPT

 

Total Sales = CALCULATE(sum(orders_[Sales]),ALL('Calendar Table'[Year]))
 
Total Sales = CALCULATE(sum(orders_[Sales]),ALLEXCEPT(orders_,'Calendar Table'[Year]))
 
 
Regards,
Ritesh
Regards,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users 
PowerBIReece
New Member

It's giving me this:

PowerBIReece_0-1656945166725.png

But I want to see these figures on the combined chart:

PowerBIReece_1-1656945218984.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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