Forum Discussion
Need formula to return certain values for different size objects
I am working to create a score card for a category. I do not know if what I am trying to do is possible.
I would like to create a dax function that compares all the text values (Size) within a group (Environment). If the text values are not the same within a given group then it should return a 0 for the record; if they are the same within a given group then return a 1.
See the below table for what the result should look like. Thank you for the assistance!
| Environment | Size | Return Value |
| Development | Standard_B4ms | 0 |
| Development | Standard_B8ms | 0 |
| Production | Standard_DS3_v2 | 0 |
| Production | Standard_DS4_v2 | 0 |
| QA | Standard_DS3_v2 | 1 |
| QA | Standard_DS3_v2 | 1 |
| Stage | Standard_DS3_v2 | 1 |
| Stage | Standard_DS3_v2 | 1 |
| UAT | Standard_DS3_v2 | 0 |
| UAT | Standard_DS4_v2 | 0 |
chall069 add following measure and that will do it
Measure = VAR __c = CALCULATETABLE ( VALUES ( 'Table (2)'[Size] ), ALLEXCEPT ( 'Table (2)', 'Table (2)'[Environment] ) ) RETURN IF ( COUNTROWS ( __c ) > 1, 0, 1 )I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos 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.⚡
3 Replies
- parry2kSuper User
chall069 add following measure and that will do it
Measure = VAR __c = CALCULATETABLE ( VALUES ( 'Table (2)'[Size] ), ALLEXCEPT ( 'Table (2)', 'Table (2)'[Environment] ) ) RETURN IF ( COUNTROWS ( __c ) > 1, 0, 1 )I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos 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.⚡
- chall069Frequent Visitor
Thank you for the assistance