Forum Discussion

TFernandes_2022's avatar
TFernandes_2022
Frequent Visitor
3 years ago
Solved

Count by Category in Matrix

Is it possible to do cumulative count by category in Matrix (Red Lines)?

 

  • Problem Solved 
    Individually counting the categories

     

    Ouro = CALCULATE(COUNT('Table'[Categoria]), 'Table'[Categoria] = "Ouro")

    Prata = CALCULATE(COUNT('Table'[Categoria]), 'Table'[Categoria] = "Prata")
    Broze = CALCULATE(COUNT('Table'[Categoria]), 'Table'[Categoria] = "Broze")

     

3 Replies

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, TFernandes_2022 

     

    What is the format of your source data? I briefly simulated some data, hoping to match your situation.

    Measure = CALCULATE(COUNT('Table'[Categoria]),ALLEXCEPT('Table','Table'[Categoria]))

    Result:

    Is this similar to what you expect?

     

    Best Regards,

    Community Support Team _Charlotte

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

    • TFernandes_2022's avatar
      TFernandes_2022
      Frequent Visitor

      Hi v-zhangti , thanks for your help. Your mock table is exactly the same as my source data, but the result I needed is the combination of the two tables.

       

  • Problem Solved 
    Individually counting the categories

     

    Ouro = CALCULATE(COUNT('Table'[Categoria]), 'Table'[Categoria] = "Ouro")

    Prata = CALCULATE(COUNT('Table'[Categoria]), 'Table'[Categoria] = "Prata")
    Broze = CALCULATE(COUNT('Table'[Categoria]), 'Table'[Categoria] = "Broze")