Forum Discussion
Anonymous
6 years agoNot applicable
Visualization to show Country only
Hi Everyone, I have a data set currently that has columns of information containing city and country. For example: When i create a visualization it will show as: Is there anyway that i ...
- 6 years ago
Hi Anonymous ,
You can create columns like DAX below.
Country = var FirstComma = FIND(",",'Table1'[Location],1) var SecondComma = FIND(",",'Table1'[Location],FirstComma + 1) var LengthOfString = LEN('Table1'[Location]) return MID('Table1'[Location],SecondComma + 1, LengthOfString - SecondComma + 1) City = var FirstComma = FIND(",",'Table1'[Location],1) var SecondComma = FIND(",",'Table1'[Location],FirstComma + 1) return LEFT(Table1[Location],SecondComma-1)Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-xicai
Community Support
6 years agoHi Anonymous ,
You can create columns like DAX below.
Country =
var FirstComma = FIND(",",'Table1'[Location],1)
var SecondComma = FIND(",",'Table1'[Location],FirstComma + 1)
var LengthOfString = LEN('Table1'[Location])
return
MID('Table1'[Location],SecondComma + 1, LengthOfString - SecondComma + 1)
City =
var FirstComma = FIND(",",'Table1'[Location],1)
var SecondComma = FIND(",",'Table1'[Location],FirstComma + 1)
return
LEFT(Table1[Location],SecondComma-1)
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.