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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
tananich
Frequent Visitor

New column with if condition

Hi All,

I am new to Power BI and would appreciate your help

I have a table in SQL which I import using Direct query in power BI. I need to create a new column with some simple data manipulations, such as IF(col1 = value && col2 = value && col 3=value, 1, 2)

I expect a new column return 1 or 2 values in each row 1 where condition is true and 2 when condition is not true.

Basically this can be any other values just to distinguish when condition is met and when is not for filtering and count

However it returns a column with random numbers.

Please help!

thnx

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Right, so the visualization is summing the column.

 

Click on the visualization > In the visualizations panel on the right, click the down-arrow highlighted in the picture below > select "Don't summarize"

 

image.png

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@tananich I don't see why your IF statement would be returning random numbers. Can you send a screenshot that includes the formula and the table?

@Anonymous

 

see below

frml.JPGcol.JPG

Anonymous
Not applicable

Right, so the visualization is summing the column.

 

Click on the visualization > In the visualizations panel on the right, click the down-arrow highlighted in the picture below > select "Don't summarize"

 

image.png

@Anonymous right, thnx a lot, dunno how i haven't noticed Smiley Embarassed

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (2,851)