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
Massingc1983
Frequent 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" in another column. Then i would like to divide the two results "Active Suppliers High Risk" by "Active Suppliers" to give a percentage.

 

I have come up witht he below formula however it gives me 100% and i am not sure where i am going wrong. Any help would be appreciated. 

 

Active Supplier ABC =
VAR ActiveSuppliers =
CALCULATE(
    DISTINCTCOUNT('Contract Append'[Supplier name]),
    'Contract Append'[Status] = "Active" )
VAR ABCHighRiskSuppliers =
CALCULATE(ActiveSuppliers, 'Contract Append'[2.2 Modern Slavery Risk Rating] = "High")
Return
DIVIDE(ABCHighRiskSuppliers, ActiveSuppliers)
4 REPLIES 4
Massingc1983
Frequent Visitor

Thank you, this worked!

Dangar332
Super User
Super User

hi, @Massingc1983 
try below 

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'[2.2 Modern Slavery Risk Rating] = "High",
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.
Anonymous
Not 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:

vrzhoumsft_0-1697525217942.png

Result is as below.

 vrzhoumsft_1-1697525229509.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you, this helped!

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.