The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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.
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.
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |