Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I have a table which is the below format:
PO# | Other columns | SOW Type |
aa | xx | a |
aa | xx | b |
aa | xx | c |
bb | xx | a |
bb | xx | b |
I want to have only 1 unique row per PO. The info in 'other columns' is the same for a given PO. So basically want to have the below output:
PO# | Other columns | a | b | c |
aa | xx | Yes | Yes | Yes |
bb | yy | Yes | Yes | No |
Please help me figure out how to achieve the above output. TIA!
Solved! Go to Solution.
Hi @SJHALANI
You can transform the table with below steps in Power Query.
First add a custom column with value "Yes".
Then select "SOW Type" column, use "Pivot Column" feature, select the earlier "Custom" column as Values Column and use "Don't Aggregate".
Finally select a,b,c columns, replace null with "No" in these columns.
You will get the result you want.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @SJHALANI
You can transform the table with below steps in Power Query.
First add a custom column with value "Yes".
Then select "SOW Type" column, use "Pivot Column" feature, select the earlier "Custom" column as Values Column and use "Don't Aggregate".
Finally select a,b,c columns, replace null with "No" in these columns.
You will get the result you want.
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi,
Thanks for the response. The only thing is when I am trying to apply the Pivot step above, it gives the below error. Would you know reason for this/how to resolve this?
Don't get confused with the "TypeOfDocument" colm, it's the same as "SOW Type" column.
TIA!
One way would be to create a matrix visual and use your SOW Type column in the Columns field well and your PO# on Rows. You can then use a measure like this one in Values to get your result. Replace Table with the name of your actual table.
HasRows = IF(ISEMPTY(Table), "No", "Yes")
Pat