Forum Discussion
ledu
6 years agoRegular Visitor
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...
- 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" })PassivesNPS - Passives =CALCULATE(COUNTA('F_Form1'[Net Promoter Type]),'F_Form1'[Net Promoter Type] IN { "Passives" })PromotersNPS - Promoters =CALCULATE(COUNTA('F_Form1'[Net Promoter Type]),'F_Form1'[Net Promoter Type] IN { "Promoters" })NPS CalculationNPS Score = (([NPS - Promoters]-[NPS - Detractors])/([NPS - Promoters]+[NPS - Detractors]+[NPS - Passives]))*100
mwegener
Most Valuable Professional
6 years agoHi ledu ,
Detractors = CALCULATE( SUM('Table'[Value]);FILTER('Table';'Table'[Column1] = "Detractors")) Promoters = CALCULATE( SUM('Table'[Value]);FILTER('Table';'Table'[Column1] = "Promoters")) Passives = CALCULATE( SUM('Table'[Value]);FILTER('Table';'Table'[Column1] = "Passives")) Measure = ([Promoters]-[Detractors])/([Detractors]+[Promoters]+[Passives])
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.