cancel
Showing results for 
Search instead for 
Did you mean: 
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
Winner of T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Find out who won the T-Shirt Design Challenge and the top 3 finalists.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.