Forum Discussion
Help needed for supplier alignment checking column in Power BI desktop
Hi,
Please consider the following table:
| Package | Project | Supplier |
| 1100 | A1 | X |
1100 | A2 | X |
| 1100 | C1 | Y |
| 1100 | A3 | |
| 2200 | P1 | X |
The request I got is to show if the group of projects (A1, A2, A3) get same vendors assigned on the tool, but for some reason, if the project in the group doesn't have the same supplier (as shown above, A3 has no assigned supplier) then in a new column I should show an expected supplier to be assigned on the project.
The other case would be if the A3 had another supplier (ex: A3 supplier assigned is Y) then the new column should show me, mismatch supplier.
Hi Anonymous ,
You need to create the following column:
P1 = LEFT('Table'[Project],1)P1 = LEFT('Table'[Project],1)maxcount1 = IF ( 'Table'[count1] = MAXX ( FILTER ( 'Table', 'Table'[P1] = EARLIER ( 'Table'[P1] ) ), 'Table'[count1] ), "match", IF ( 'Table'[count1] <> MAXX ( FILTER ( 'Table', 'Table'[P1] = EARLIER ( 'Table'[P1] ) ), 'Table'[count1] ) && 'Table'[Supplier] = BLANK (), CALCULATE ( MAX ( 'Table'[Supplier] ), FILTER ( ALL ( 'Table' ), 'Table'[P1] = EARLIER ( 'Table'[P1] ) && 'Table'[count1] = MAXX ( FILTER ( 'Table', 'Table'[P1] = EARLIER ( 'Table'[P1] )),'Table'[count1]))),"mismatch" ) )Output refer:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien
2 Replies
- lbendlin
Super User
Those cases are identical. "No supplier" is the same as "Different Supplier"
- v-luwang-msft
Community Support
Hi Anonymous ,
You need to create the following column:
P1 = LEFT('Table'[Project],1)P1 = LEFT('Table'[Project],1)maxcount1 = IF ( 'Table'[count1] = MAXX ( FILTER ( 'Table', 'Table'[P1] = EARLIER ( 'Table'[P1] ) ), 'Table'[count1] ), "match", IF ( 'Table'[count1] <> MAXX ( FILTER ( 'Table', 'Table'[P1] = EARLIER ( 'Table'[P1] ) ), 'Table'[count1] ) && 'Table'[Supplier] = BLANK (), CALCULATE ( MAX ( 'Table'[Supplier] ), FILTER ( ALL ( 'Table' ), 'Table'[P1] = EARLIER ( 'Table'[P1] ) && 'Table'[count1] = MAXX ( FILTER ( 'Table', 'Table'[P1] = EARLIER ( 'Table'[P1] )),'Table'[count1]))),"mismatch" ) )Output refer:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien