Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
nickspizza
Helper I
Helper I

Create new column with integer values

I created new columns from if/then/else formulas where the output is either a number or null, but I can't aggregate them without getting an error saying that this new column that I'm trying to aggregate is a string. What can be the possible causes for this?

 

Created them in the transformation tab. Trying to aggregate them in the report in DAX. I created them with this kind of formula

 

= Table.AddColumn(#"Added Custom44", "Pure Connect Res", each if [Product Sales TGT] = "Pure Connect Res" then 1 else if [Product Sales TGT] = "Conventional Line Res" then 1 else 0)

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@nickspizza , Make sure data type of this column is numeric like whole number or decimal in power query

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@nickspizza , Make sure data type of this column is numeric like whole number or decimal in power query

Okay thank you. I didn't know that you need to manually choose the data type for every column after creating it in Transformation. It seems to work

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.