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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
User202
Regular Visitor

Power BI measure to remove a filter

Hi,

 

I am trying to make a measure to calculate a percentage where the nominator would be affected by all of the on page filters (slicers) and the denominator would be affected by 3 out of the 4 slicers. 

i have made a measure calculating the nominator as:

total staff=

countrows('staff')

this accounts for all filters

 

the denominator i created as 

total staff 2 =
calculate(

countrows('staff'),

removefilters('staff')[country])

 

however the total staff 2 removing filters is giving the same number as the total staff when i apply a filter to the country slicer. I would like the percentage to show the staff in a country/by the total staff where i can adjust the date slicer and the percentage will factor this in. My final percentage would use the measure total staff/total staff 2

thank you in advance 

2 REPLIES 2
rajendraongole1
Super User
Super User

Hi @User202 - create a measure that calculates a percentage where the numerator for staff count table as below:

Measure1:

Total Staff = COUNTROWS('Staff')

 

This measure should ignore the Country filter but consider all other filters. Instead of using REMOVEFILTERS

You can use this measure for denominator

Total Staff Ignoring Country =
CALCULATE(
COUNTROWS('Staff'),
ALL('Staff'[Country])
)

create last measure to get the percentage calculation%

 

Percentage Staff by Country =
DIVIDE(
[Total Staff],
[Total Staff Ignoring Country],
BLANK()
)

 

It works. please check

 

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi,

 

I have tried the ALL option instead of REMOVEFILTERS and this also does not work. The only solution I have come up with so far is duplicating the table which is not the most ideal solution 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.