Forum Discussion
Anonymous
3 years agoNot applicable
How to write condition in power query to check multiple rows
Like below table, if same PO has 2 lines , i want to check if the value in "Plant" column. If it is same, than add a new column to result "Same Plant", if it's different, then result " Multiple Plant...
- 3 years ago
see me video
How to write condition.mp4
Sample PBIX file attached
https://1drv.ms/u/s!AiUZ0Ws7G26Rh0HdYsuuz8d8xhnU?e=zXb8Vx
DOLEARY85
Resident Rockstar
3 years agoHi,
you can do this in a few steps:
- Group By on PO & Plant, adding a count rows aggregation and the data for all other columns in all rows to be expanded later:
- Add a custom column for if the count rows field is greater than 1 same plant else multiple plant: if [Count] > 1 then "Same Plant" else "Multiple Plant"
- Expand the data rows to get any other data back
- remove the count rows column:
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍
Anonymous
3 years agoNot applicable
I have followed by tyour steps, but there's something wrong, and some times the same PO may have 4 lines, I need result to indicate this PO has "Multiple Plant"