Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I have Order and Name column.. I want to check If against one unique Order "Name" contains "Ali" and "Saqib" It should return 1 in result coulmn otherwise 0, Just like in followwing example in Order Column only B has "Ali" and "Saqib" so result should be 1 only for B. How to achieve this?
| Order | Name | Result |
| A | Ali | 0 |
| A | Muhammad | 0 |
| A | Ashraf | 0 |
| B | Ali | 1 |
| B | Saqib | 1 |
| C | Ali | 0 |
Solved! Go to Solution.
Try this DAX:
Result =
var Ali = CALCULATE(COUNTROWS(Sheet1),FILTER(ALLEXCEPT(Sheet1,Sheet1[Order]),Sheet1[Name]="ali"))
var Saqib = CALCULATE(COUNTROWS(Sheet1),FILTER(ALLEXCEPT(Sheet1,Sheet1[Order]),Sheet1[Name]="saqib"))
Return IF(Ali>=1 && Saqib>=1,1,0)
Best Regards
Paul Zheng
Try this DAX:
Result =
var Ali = CALCULATE(COUNTROWS(Sheet1),FILTER(ALLEXCEPT(Sheet1,Sheet1[Order]),Sheet1[Name]="ali"))
var Saqib = CALCULATE(COUNTROWS(Sheet1),FILTER(ALLEXCEPT(Sheet1,Sheet1[Order]),Sheet1[Name]="saqib"))
Return IF(Ali>=1 && Saqib>=1,1,0)
Best Regards
Paul Zheng
Thanks alot, man thats work absolutly perfect, just one more thing, how can I have disticnt count of order wher result is 1, in this case answer is 2 because only B and C have 1 in result column. how can I get this 2?
Once you have your expected [Result] column, you can distinctcount [Order], and set a filter to [Result] column:
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.