Forum Discussion
Creating New column by copying specific data from one column to another
I'm trying to create new colums for Carry Metres and Kick Metres based on a data set that looks like below. I need to copy the Carry Metres into a seperate column and the same with the Kick Metres and dont know how to do it, any help would be greatly appreciated.
| Action | Metres | Carry Metres | Kick Metres |
| Carry | 5 | ||
| Carry | 15 | ||
| Kick | 28 | ||
| Carry | 3 | ||
| Kick | 34 | ||
| Kick | 21 | ||
| Carry | 34 |
Hi , jamieham
Try to create calculated column as below:
Carry_Metres = IF(Table_basic[Action]="Carry",Table_basic[Metres],BLANK())Kick_Metres = IF(Table_basic[Action]="Kick",Table_basic[Metres],BLANK())For more details,please refer to the sample file.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- AnonymousNot applicable
Hi jamieham
Not very clear. What is your end goal?
How about creating a duplicate column for both.
Otherwise
carry meter new = [carry meter]
Kick meter new = [Kick meter]
- jamieham
Helper II
I need to be able to seperate the kick metres and carry metres into different columns. At the moment kick and carry metres are both in the same column
- v-easonf-msft
Community Support
Hi , jamieham
Try to create calculated column as below:
Carry_Metres = IF(Table_basic[Action]="Carry",Table_basic[Metres],BLANK())Kick_Metres = IF(Table_basic[Action]="Kick",Table_basic[Metres],BLANK())For more details,please refer to the sample file.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi jamieham
I would go to Power Query editor
Select these two columns
On the transform menu --> Pivot(Hope you have other columns in this table otherwise it will error out)
- amitchandak
Super User
jamieham , pivot - This should work in your case
https://radacad.com/pivot-and-unpivot-with-power-bi
Group data
https://www.poweredsolutions.co/2019/07/30/grouping-rows-with-power-bi-power-query/
- v-easonf-msft
Community Support
Hi , jamieham
By the way ,if you use the function "pivot column" in "Transform Data", it is suggest to create a index column first .
Best Regards,
Community Support Team _ Eason