Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Solved! Go to Solution.
Hi @Anonymous
I would recommend handling this further upstream (data source or Power Query).
However, here is a DAX expression you could use for a calculated column:
Latitud Decimal =
VAR DMS = [Latitud Fin] // Ideally prefix with table name e.g YourTable[Latitud Fin]
VAR DMS_Delimited =
SUBSTITUTE ( SUBSTITUTE ( SUBSTITUTE ( DMS, "°", "|" ), "'", "|" ), """", "" )
VAR Grados =
VALUE ( PATHITEM ( DMS_Delimited, 1 ) )
VAR Minutos =
VALUE ( PATHITEM ( DMS_Delimited, 2 ) )
VAR Segundos =
VALUE ( PATHITEM ( DMS_Delimited, 3 ) )
VAR Result = Grados + Minutos / 60 + Segundos / 3600
RETURN
Result
This changes the delimiters to vertical bars, which allow for convenient splitting of the string with the PATHITEM function.
Regards
Hi @Anonymous
I would recommend handling this further upstream (data source or Power Query).
However, here is a DAX expression you could use for a calculated column:
Latitud Decimal =
VAR DMS = [Latitud Fin] // Ideally prefix with table name e.g YourTable[Latitud Fin]
VAR DMS_Delimited =
SUBSTITUTE ( SUBSTITUTE ( SUBSTITUTE ( DMS, "°", "|" ), "'", "|" ), """", "" )
VAR Grados =
VALUE ( PATHITEM ( DMS_Delimited, 1 ) )
VAR Minutos =
VALUE ( PATHITEM ( DMS_Delimited, 2 ) )
VAR Segundos =
VALUE ( PATHITEM ( DMS_Delimited, 3 ) )
VAR Result = Grados + Minutos / 60 + Segundos / 3600
RETURN
Result
This changes the delimiters to vertical bars, which allow for convenient splitting of the string with the PATHITEM function.
Regards
infinitely grateful 🤜🤛
User | Count |
---|---|
85 | |
82 | |
66 | |
53 | |
47 |
User | Count |
---|---|
101 | |
51 | |
41 | |
39 | |
38 |