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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
alhyde
New Member

IF Statement in DAX Help

I have data in column A that I want to filter into two columns - column B and column C.  Column A contains both negative and positive numbers.  I want postive numbers in column B and negative numbers in column C.  In Excel, this would be a simple IF statment, but I am unsure how to write this in DAX.  Help, please!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@alhyde

 

1. ColumnB= If ( YourTable[ColumnA] >= 0 , YourTable[ColumnA])

 

2. ColumnC= if ( If ( YourTable[ColumnA] < 0 , YourTable[ColumnA])

 

If this works for you please accept this as a solution and also give KUDOS.

 

Cheers

 

CheenuSing

View solution in original post

7 REPLIES 7
RobJo
Helper I
Helper I

@CheenuSing

 

Hi, 

 

Thanks for your support. 

 

I don't know how to post sample files on this forum. 
Here is my e-mail adres: rob_jouvenaar@hotmail.com

Please send me a email and i will reply you the sample files.  OK?

 

Rob Jouvenaar

 

Anonymous
Not applicable

Hi @RobJo

 

I have sent a mail to your hotmail account. Please check and respond.

 

Cheers

 

CheenuSing

RobJo
Helper I
Helper I

@CheenuSing

 

Hello,

 

I had the same question and managed to split the values of column A (amount) over column B (debet) and column C (credit).
Column A is a measure: SUM(table[Amount]). 
The issue i have is in the totals. 
I would like to summerize all (postive) amounts of column B and the (negative) amounts of column C, 

With this solution above i get totals with 0 and i don't understand that. 

Can you please help me with this?

Rob 

Anonymous
Not applicable

Hi @RobJo

 

Please post sample data and the expressions used.

 

Cheers

 

CheenuSing

blopez11
Super User
Super User

Try doing it in the query editor

You can either create two new columns (B and C), one with the positive values, and one with the negative values

Or create one with the negative values, then filter out the negative values from column A

Anonymous
Not applicable

@alhyde

 

1. ColumnB= If ( YourTable[ColumnA] >= 0 , YourTable[ColumnA])

 

2. ColumnC= if ( If ( YourTable[ColumnA] < 0 , YourTable[ColumnA])

 

If this works for you please accept this as a solution and also give KUDOS.

 

Cheers

 

CheenuSing

Thank you for your help, @Anonymous!!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors