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 September 15. Request your voucher.

Reply
Anonymous
Not applicable

Percent of total column with dynamic filter

Hi,

I'm new to Power Pivot ")

trying to calculat the percantage of total column for several columns (years).

when i use the "ALLSELECTED" formula, i get the percentage of the Grand total and not by column.

Help would be much appreciated. 

this is the formula im using:

DIVIDE([Sum of Volume (SU)],CALCULATE([Sum of Volume (SU)],ALLSELECTED(Consolidatedtable)))

 

1 ACCEPTED SOLUTION

@Anonymous 

Try the following measure, you need to remove the filter on the SUB_CATEGIORY COLUMN

Vol Mix % = 
DIVIDE(
    [Sum of Volume (SU)],
    CALCULATE(
        [Sum of Volume (SU)],
        ALLSELECTED(Consolidatedtable[2.9.8 SUB CATEGORY_EN])
    )
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

7 REPLIES 7
Fowmy
Super User
Super User

@Anonymous 

Can you share a screenshot or p[rovide sample data and the expected results?

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Hi,

total colums should amount to 100%.

The Pivot table is combined (appended) of two tables (2020 / 2021).

Thanks

Adam_D_0-1622039386322.png

 

@Anonymous 

Try the following measure, you need to remove the filter on the SUB_CATEGIORY COLUMN

Vol Mix % = 
DIVIDE(
    [Sum of Volume (SU)],
    CALCULATE(
        [Sum of Volume (SU)],
        ALLSELECTED(Consolidatedtable[2.9.8 SUB CATEGORY_EN])
    )
)
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

so basically i need to add a filter reference in the CALCULATE formula that is the same as the dimension ? meaning if i change the dimension from SUB-CATEGORY to CATEGORY, the formula will not work. Is there a different way to calculate the percentage the will be dynamic for any column\row change in the pivot table?

thanks 🙂

@Anonymous 

 

Not possible to keep it dynamic as you need to remove filter only on the rows and keep the filter on the columns. 

if you apply ALLSELECTED() without parameter as an argument to CALCULATE, it will remove all the filters within the visual. 

the solution is to create individual measures. 

hope it clarified 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

I tried creating individual measures for each year, but now i get duplicate fields, 

under each year column i get both years data.

this is the DAX i used.

please HELP!

DIVIDE(SUMX(Conso,[Total Volume 2020]),CALCULATE([Total Volume 2020],ALLSELECTED()))

 

Adam_D_0-1622054850484.png

 

 

 

 

@Anonymous 

Add an IF condition:
If ( selectedvalue(Table[Year]) = 2020, 
DIVIDE(SUMX(Conso,[Total Volume 2020]),CALCULATE([Total Volume 2020],ALLSELECTED()))
)

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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