Forum Discussion
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!
- Anonymous9 years ago
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
7 Replies
- AnonymousNot applicable
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
- alhydeNew Member
Thank you for your help, Anonymous!!
- blopez11Super 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
- RobJoHelper I
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
- AnonymousNot applicable
- RobJoHelper I
Hi,
Thanks for your support.
I don't know how to post sample files on this forum.
Here is my e-mail adres: [email protected]Please send me a email and i will reply you the sample files. OK?
Rob Jouvenaar
- AnonymousNot applicable