Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Before I write my python script the 'Period' Column is of type Text but after I apply my script 'Period' becomes of type Date
How to I get it to stop automatically changing the data type? I want to keep it of type Text because then the script doesn't find the conditional statement that I am making.
Before:
After Script:
I've used this same code in Jupyter Notebook and it did exactly what I wanted.
Solved! Go to Solution.
Hi, @adamabdell ;
You could delete it in power query.
First open Formula Bar,
Then delete the date's type.
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @adamabdell ;
You could delete it in power query.
First open Formula Bar,
Then delete the date's type.
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Change it by clicking the calendar icon then select the text type
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
@mh2587 thank you for your response!
I have done that. But the issue is that the script is then not recognizing the change.
My table has 2 columns. Period and Value.
My script basically says:
if Period = 'a period':
then Value - 100
else:
then Value - 50
And with using pandas in the the return values are being stored in a new column
Does that make sense?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
57 | |
38 | |
36 |
User | Count |
---|---|
82 | |
67 | |
61 | |
46 | |
45 |