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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.