March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi. I'm wondering if this is a bug or intentional and if there's a smarter workaround.
I have a # of hours column in direct query. Power BI recognizes that it is a number.
Through the query editor, I add a column for # of days. (= # of hours /24)
As soon as I add this column, Power BI automatically converts the data type of both this and the original column to text, even though it does the math just fine.
When I try to do the type conversion in the query editor, it won't let me. I have to do it from the main screen, but I get the potential data loss pop up by doing it that way.
Why would it initially recognize a column as a number and then after using it to divide automatically switch it to text?
I'm making a custom column, with the formula [days]/24
Hi @sp8
I can't reproduce your problem on my side.
Do you use the lastest version?
Could you show some screenshots and more other details (eg. code in Advanced editor)?
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I'm using the latest version.
Here is my custom column. It's really simple.
Hi @sp8
Sorry, I still can't reproduce yout problem.
I can change the data type to number.
Maybe you can share me with the code to check clearly.
Or you could create a measure directly:
Measure = SUM('Sheet2$'[amount])/24
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Sorry if I wasn't clear. I can manually change it to number type. My only issue is with the automatic behavior.
I'm saying that when I connect to the table, the type is number and then when I add the new (/24) column, PBI automatically changes the type from number to text. This is why I have to manually change it.
But that doesn't make sense as it was a number type before, and then I did a number function to it (division), so why would it change to a text type after that?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |