Forum Discussion
Check if the combination occurs within a table
I have a table. I want to create a column for evaluating if the combination occurs within a table.
See the example below:
| Name | Category | Ok/NotOk |
| A | PDE | OK |
| A | KDE | OK |
| B | PDE | OK |
| B | PDE | OK |
| B | KDE | OK |
| C | KDE | NotOK |
| C | KDE | NotOK |
| D | KDE | NotOK |
| D | KDE | NotOK |
| D | KDE | NotOK |
In the example above, I have a name and Category columns. If the Category column ="PDE", "Ok/NotOk" = "OK" for all the rows across the Name column.
Hi Anonymous
Try this, create the column,
Ok/NotOk = var _count=CALCULATE(COUNTROWS('Table'),FILTER(ALLEXCEPT('Table','Table'[Name]),'Table'[Category] = "PDE")) return IF(_count>0,"OK","NotOK")result
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- parry2k
Super User
Anonymous add new column and it will return true or false
Column = VAR __exists = CALCULATE ( COUNTROWS ( test ), ALL ( test ), test[Category] = "PDE", test[Ok/NotOk] = "OK" ) RETURN NOT ISBLANK ( __exists )✨ Follow us on LinkedIn
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) 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.⚡
- v-xiaotang
Community Support
Hi Anonymous
Try this, create the column,
Ok/NotOk = var _count=CALCULATE(COUNTROWS('Table'),FILTER(ALLEXCEPT('Table','Table'[Name]),'Table'[Category] = "PDE")) return IF(_count>0,"OK","NotOK")result
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.