Forum Discussion

mmh9119's avatar
mmh9119
Frequent Visitor
2 years ago
Solved

Calculate values in one measure using DAX

Hi all,   Simple issue. I have a percentage calculation measure that I'm using in a Card Visual. The issue is, in order to calculate this percentage, I need to calculate the total in one measure, t...
  • shop-tinh-yeu's avatar
    2 years ago

    PC_Percentage =
    DIVIDE (
    CALCULATE (
    COUNTROWS ( Table1 ),
    FILTER ( ALLSELECTED ( Table1 ), Table1[Jurisd] = "Provincial" )
    ),
    COUNT ( Table1[PersonId] ),
    0 -- Add a default value for divide to handle potential division by zero
    )