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
gcrisp
Regular Visitor

How to find % of total with multiple filters in place.

I have a file that contains the following information: 

Drug Type (Generic, Brand, Specialty)

Rx Count (n=1)

Disease State Grouper (many different categories)

 

I am trying to find out what % of Rx Count is Generic but with Disease State Grouper (Vaccinations) excluded.

 

The issue I am running into is that for the denominator, I want it to be all Disease States within grouper Except Vaccines and the numerator to only include Drug type of Generic.  I cannot seem to find a way to do both and keep the % filtered.

 

Thanks for your help.

3 REPLIES 3
FreemanZ
Super User
Super User

hi @gcrisp 

are you expecting something like:

 

 

Pct =
VAR _b = 
COUNTROWS(
    FILTER(
        TableName,
        TableName[Disease State Grouper] <>"Vaccines"
)
VAR _a = 
COUNTROWS(
    FILTER(
        TableName,
        TableName[Disease State Grouper] <>"Vaccines"            
            &&TableName[Drug Type]="Generic"
)
RETURN
DIVIDE(_a, _b)

 

 

I am a beginner with this so I am wondering if it is not working because I am putting the wrong thing for "pct", Var_a and Var_b.  Should those be something more specific than as typed?

 

Trying that now.  That looks similar to what I was doing.

 

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.