Forum Discussion
Create a custom measure based on matrix
- 4 years ago
Anonymous try this:
Total Count = COUNTROWS ( YourTable ) Calc = DIVIDE ( CALCULATE ( [Total Count], YourTable[NPS_Segment] = "Promoter" ) - CALCULATE ( [Total Count], YourTable[NPS_Segment] = "Detractor" ), [Total Count] )✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
Anonymous try this:
Total Count = COUNTROWS ( YourTable )
Calc =
DIVIDE (
CALCULATE ( [Total Count], YourTable[NPS_Segment] = "Promoter" ) -
CALCULATE ( [Total Count], YourTable[NPS_Segment] = "Detractor" ),
[Total Count]
)
✨ Follow us on LinkedIn and to our YouTube channel
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
- Anonymous4 years agoNot applicable
Thanks for the repy parry2k . However, the calculation doesn't seem correct. It doesn't give me the expected result (expected output = 46.07%, actual output = 2.98%).
I checked, and for example each calculation within the divide does not give me the correct value. For example,CALCULATE ( 'NPS_Redeemers'[Total Count], 'NPS_Redeemers'[NPS_SEGMENT] = "Promoter" ) evaluate to 397 when it should actually just be equal to the Count of Promoter from the matrix, i.e. 5402.