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.
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?
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |