Forum Discussion
Massingc1983
2 years agoFrequent Visitor
Filtered DAX Measure
Hi I am trying to work out a percentage based on filtered measures. The first measure is number of "Active" suppliers. The second is number of those active suppliers who are marked as "High Risk"...
Dangar332
2 years agoResident Rockstar
hi, Massingc1983
try below
Active Supplier ABC =
VAR ActiveSuppliers =
CALCULATE(
DISTINCTCOUNT('Contract Append'[Supplier name]),
'Contract Append'[Status] = "Active" )
VAR ABCHighRiskSuppliers =
CALCULATE('Contract Append'[Supplier name]), 'Contract Append'[2.2 Modern Slavery Risk Rating] = "High",)
DISTINCTCOUNT(
KEEPFILTERS('Contract Append'[Status] = "Active"))
Return
DIVIDE(ABCHighRiskSuppliers, ActiveSuppliers)
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly. Appreciate your kudos.
- Anonymous2 years agoNot applicable
Hi Massingc1983 ,
I don't suggest you to use "ActiveSuppliers" part in "ABCHighRiskSuppliers", use DISTINCTCOUNT() function again in "ABCHighRiskSuppliers".
Active Supplier ABC = VAR _ActiveSuppliers = CALCULATE ( DISTINCTCOUNT ( 'Contract Append'[Supplier name] ), 'Contract Append'[Status] = "Active" ) VAR _ABCHighRiskSuppliers = CALCULATE ( DISTINCTCOUNT ( 'Contract Append'[Supplier name] ), 'Contract Append'[Status] = "Active", 'Contract Append'[2.2 Modern Slavery Risk Rating] = "High" ) RETURN DIVIDE ( _ABCHighRiskSuppliers, _ActiveSuppliers )It works on myside. My Sample:
Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Massingc19832 years agoFrequent Visitor
Thank you, this helped!