Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
Let's say i have 10 columns (could be any number of columns) in a dataset. A randon number of headings (I do not know the position of those columns) contain the word birthdate - so the heaidngs could be 1 Birthdate, 2 Birthdate, 3 Birthdate etc. In which ever cells of the headings the word Birthdate is found, I'd like all entries under those columns to be formatted as Dates.
Please help.
Hi @Ashish_Mathur ,
Add Python script to power query as below:
import pandas as pd
for col in dataset.columns:
if col.find("Birthday") ==-1:
pass
else:
dataset[col] = pd.to_datetime(dataset[col], errors='coerce')
it should return a table with changed datatype.
Thank You,
Washivale
Hi,
Thank you for replying. Is there a way of doing this in the M language?
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |