Forum Discussion

OrthoData's avatar
OrthoData
Frequent Visitor
6 years ago
Solved

Percent of multiple subsets over time

Greetings, all! I have a group of categories each with subcategories and totals for all. For example: Category Subcategory Count of Events 1 A ### 1 B ### 1 C ### 2 A ###...
  • v-kelly-msft's avatar
    6 years ago

    Hi OrthoData ,

     

    You need a measure to calculate % of all A's for total all events as below:

     

     

    Measure = 
    DIVIDE(CALCULATE(SUM('Table'[Count of Events]),ALLEXCEPT('Table','Table'[Subcategory])),CALCULATE(SUM('Table'[Count of Events]),ALL('Table')))

     

     

    And you will see:

     

    Then you need a measure to calculate the percentage of SubCat A for each respective Category as below :

     

     

    Measure 2 = DIVIDE(CALCULATE(SUM('Table'[Count of Events]),ALLEXCEPT('Table','Table'[Category]),FILTER('Table','Table'[Subcategory]=SELECTEDVALUE('Table'[Subcategory]))),CALCULATE(SUM('Table'[Count of Events]),ALL('Table')))

     

    And you will see:

     

    For the related .pbix file,pls click here.

     

    Best Regards,
    Kelly