Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. 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 |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |