Limits in formulas because of datatype Hi! I dont know if its only me having this problem but in excel I have never had difficulties creating advanced formulas with different types of data, for example making a sum (value) when I find a specific word (text). In Power BI I have set the datatype the same for several columns of which I need to create new calculated columns for in my report. But when trying to add a new formula column i get the error that the formula cant work with different datatypes (expressions that yield variant data-type cannot be used to define calculated columns). First of all I dont know if there is a background set that mess up the datatype though I have set the same format for all the data. Second it is possible to create the same formula I have made in excel, which works perfectly. I don't see the problem why it shouldn't work in Power BI?
5 Comments
- colinbanfield1New MemberI'm afraid that the likelihood of this request being accepted is very low. M is a fairly strongly typed language by design. Strongly typed systems not support type coercion because it is dangerous and error prone. You must explicitly convert a number stored as text to a number, for example, if you want use the text number with other real numeric data.
- ella_halden1New MemberAnd I don't know which data it refers to either though it does not name the data that is supposed to have the wrong datatype
- ella_halden1New MemberBut I believe there should be a difference between the Query editor language and the "new measure/New column" in the report view. I can understand if this blocks measueres in the query editor but if I have set all the data with the same datatype according to the "Data" view, it should not claim that the datatype is wrong when trying to create a simple formula for a new column or measure in the report view. If it does it should show me which value is wrong so that I can analyze why it's doing this, now I can't even understand why PBI is claiming that the datatype is wrong when it should not be.
- hdfulks1New MemberI've found that the typical problem is often in mixing the data types that are generated by the logical calculation will cause this error. Be sure to create consistent data type results in your formulas. I was evaluating bit columns and converting the result to a string but left the last logical check result equal to a zero. Changing it to "None" fixed the type error. Hope that helps.
- fbcideas_migusrNew MemberStatus added:Needs Votes
Recent ideas
Power Query Parameter create/use when connecting to a dataflow
In power query when you connect to a table in a dataflow there are no options to create or use a parameter for that dataflow. When connecting to SQL there is an option when setting up the connection ...ben_holmes2 hours agoNew MemberNeed Clarification196Views3likes1CommentParameterize Dataflow Gen2 data source connection
Allow the Dataflow Gen2 data source connection GUID to be parameterized and stored in a Variable Library. This would allow the same Dataflow to use different connections depending on the workspace/e...frithjof_v2 hours agoCommunity ChampionNeeds Votes36Views2likes1CommentExpose Power Query as a Standalone Runtime and Command-Line Interface (CLI)
Summary Power Query has evolved into one of Microsoft's most powerful data transformation technologies and is now used across Excel, Power BI, Fabric, Dataflows, Power Platform, and other products. ...juansgr_2 hours agoNew MemberAbandoned20Views0likes2CommentsExpose User Prompt and Agent Response Logs for Fabric Data Agents
Idea: As an engineer responsible for managing and improving Microsoft Fabric Data Agents, I currently have no way to view how users are interacting with the agents I’ve built. While it’s likely that...JoshuaPitzer4 hours agoAdvocate INew1.2KViews26likes2CommentsImprove relationship visualisation in Model View for large semantic models.
When working with complex models containing many fact and dimension tables, relationship lines frequently cross and overlap, making lineage difficult to follow. A useful enhancement would be to allo...jcheeseaos5 hours agoNew MemberNew12Views0likes0Comments