Forum Discussion

ledu's avatar
ledu
Regular Visitor
6 years ago
Solved

Countif formula in PowerBi

Hi everyone,   I was hoping for some help with a formula in PowerBi similar to a countif.   I have a column that contains Detractors Promoters Passives Null I need to calculate a new measu...
  • ledu's avatar
    6 years ago

    Hi everyone!

     

    Thank you all for your help. I realized that I was making this extra tricky and ended up using "quick measures" instead.

     

    The formulas looked like this:

    Detractors

    NPS - Detractors =
    CALCULATE(
        COUNTA('F_Form1'[Net Promoter Type]),
        'F_Form1'[Net Promoter Type] IN { "Detractors" }
    )
     
    Passives
    NPS - Passives =
    CALCULATE(
        COUNTA('F_Form1'[Net Promoter Type]),
        'F_Form1'[Net Promoter Type] IN { "Passives" }
    )
     
    Promoters
    NPS - Promoters =
    CALCULATE(
        COUNTA('F_Form1'[Net Promoter Type]),
        'F_Form1'[Net Promoter Type] IN { "Promoters" }
    )
     
    NPS Calculation
    NPS Score = (([NPS - Promoters]-[NPS - Detractors])/([NPS - Promoters]+[NPS - Detractors]+[NPS - Passives]))*100