Forum Discussion
Replace value and move to different column?
- 6 years ago
Right, there is no magic bullet for that. What I did was take the values in your Country/Region table and copied them. I pasted these into a new Enter Data query called Table. I then added a column for Region and put values in there for the region. Now, I got lazy and because I am from the US my geography skills suck so there are a lot of Europe's in there. Just click the gear icon next to the Source step and correct all that to what you want. It's manual, but you only have to do it once.
Now, I then added a Merge Queries step to the COVID-19 table that merges this new Table into the COVID-19 table so that you now have the desired Region column. Updated PBIX is attached.
Greg: Thanks. That gets me to the last step, which is replacing the data in the Country/Region column with larger Regions, e.g., "Europe", "North America", etc.
I am thinking that if I filtered the Country/Region column to, e.g., just European countries I could replace the values in that column with "European Region" or something like that.
It is easy enough to replace the values individually, but is there a way to replace every value in the (filtered) Country/Region column with one value?
Right, there is no magic bullet for that. What I did was take the values in your Country/Region table and copied them. I pasted these into a new Enter Data query called Table. I then added a column for Region and put values in there for the region. Now, I got lazy and because I am from the US my geography skills suck so there are a lot of Europe's in there. Just click the gear icon next to the Source step and correct all that to what you want. It's manual, but you only have to do it once.
Now, I then added a Merge Queries step to the COVID-19 table that merges this new Table into the COVID-19 table so that you now have the desired Region column. Updated PBIX is attached.
- MojoGene6 years agoPost Patron
Greg:
Thanks once again. I was working on my own solution, but it was very inelegant compared to yours.
I'm on the right track now.
Thanks again.
- Greg_Deckler6 years agoCommunity Champion
MojoGene - Great! Let me know if you need anything else. It's a snowy Saturday here so I'm just chilling out and answering forum questions. There is zero to do here because of all this #@!$#!# COVID-19 @#$#@#@ shutting absolutely everything down here in the US.