Chelena
New member
Hi
I work with pediatric data and have the age in days that I derived from Add column --> Date --> Age. I want to convert that age in days (766) to this:
"2y; 1m; 4d". I use it repeatedly.
The DAX formula works but I would like to use it in PQ as a custom column in M please. I tried replacing INT to Int64 but no luck.
Thank you for our time.
I work with pediatric data and have the age in days that I derived from Add column --> Date --> Age. I want to convert that age in days (766) to this:
"2y; 1m; 4d". I use it repeatedly.
The DAX formula works but I would like to use it in PQ as a custom column in M please. I tried replacing INT to Int64 but no luck.
Code:
[FONT=arial]col = INT([Age]/365.2425)&"y; " & INT(([Age]-INT([Age]/365.2425)[/FONT][FONT=arial]*365.2425)/30.44)&"m; " &INT([Age]-INT([Age]/365.2425)[/FONT][FONT=arial]*365.2425-INT(([Age]-INT([Age][/FONT][FONT=arial]/365.2425)*365.2425)/30.44)*[/FONT][FONT=arial]30.44)&"d"
[/FONT]
Thank you for our time.