Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I would like to get help to extract out details from an identity card eg 671109106173.
1) The last digit refers to gender. Odd refers to Male and Even refers to female.
2) Age is 2020-1967 (first 2 digits)=53.
3) The 7 to 8 digit refers to the state of birth. So, 10 refers to Selangor
01 | Johor |
02 | Kedah |
03 | Kelantan |
04 | Malacca |
05 | Negeri Sembilan |
06 | Pahang |
07 | Penang |
08 | Perak |
09 | Perlis |
10 | Selangor |
11 | Terengganu |
12 | Sabah |
13 | Sarawak |
14 | Federal Territory of Kuala Lumpur |
15 | Federal Territory of Labuan |
16 | Federal Territory of Putrajaya |
17 | N/A |
18 | N/A |
19 | N/A |
20 | N/A |
21 | Johor |
22 | Johor |
23 | Johor |
24 | Johor |
25 | Kedah |
26 | Kedah |
27 | Kedah |
28 | Kelantan |
29 | Kelantan |
30 | Malacca |
31 | Negeri Sembilan |
32 | Pahang |
33 | Pahang |
34 | Penang |
35 | Penang |
36 | Perak |
37 | Perak |
38 | Perak |
39 | Perak |
40 | Perlis |
41 | Selangor |
42 | Selangor |
43 | Selangor |
44 | Selangor |
45 | Terengganu |
46 | Terengganu |
47 | Sabah |
48 | Sabah |
49 | Sabah |
50 | Sarawak |
51 | Sarawak |
52 | Sarawak |
53 | Sarawak |
54 | Federal Territory of Kuala Lumpur |
55 | Federal Territory of Kuala Lumpur |
56 | Federal Territory of Kuala Lumpur |
57 | Federal Territory of Kuala Lumpur |
58 | Federal Territory of Labuan |
59 | Negeri Sembilan |
Solved! Go to Solution.
Gender = IF(ISODD(RIGHT([Column],1)*1),"Male","Female")
Age =
VAR __Year = LEFT([Column],2) * 1
RETURN
IF __Year < 20, 2000+__Year,1900+__Year)
State =
VAR __Code = MID([Column],7,2)
RETURN
MAXX(FILTER('States',[Code]=__Code),[State])
Gender = IF(ISODD(RIGHT([Column],1)*1),"Male","Female")
Age =
VAR __Year = LEFT([Column],2) * 1
RETURN
IF __Year < 20, 2000+__Year,1900+__Year)
State =
VAR __Code = MID([Column],7,2)
RETURN
MAXX(FILTER('States',[Code]=__Code),[State])
@flintstone , In dax you can use left, right and mid
https://docs.microsoft.com/en-us/dax/left-function-dax
https://docs.microsoft.com/en-us/dax/right-function-dax
https://docs.microsoft.com/en-us/dax/mid-function-dax
Get the values and you can match
left([col],2) is your year of birth
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
70 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |