Forum Discussion
gsed99
8 years agoHelper III
Nested IF Statement with math on column
Hello, I want to perform an IF Statement on a column which is formatted in YYYYMM. I have been able to do this in Excel, but new to DAX and PowerBI. Here is my formula in Excel: =IF(RIGHT(A3,2)=...
- 8 years ago
I was able to get it to work, had to apply a FORMAT expression on the last part:
DateStampMonth New = IF(RIGHT('Marketing Snapshot'[DateStampMonth],2)="01",LEFT('Marketing Snapshot'[DateStampMonth],4)-1&13,FORMAT('Marketing Snapshot'[DateStampMonth],"General Number"))
gsed99
8 years agoHelper III
Hmmm, I get an error saying "Expressions that yield varian data-type cannot be used to define calculated columns."
Can you paste the formula that worked for you?
gsed99
8 years agoHelper III
I was able to get it to work, had to apply a FORMAT expression on the last part:
DateStampMonth New = IF(RIGHT('Marketing Snapshot'[DateStampMonth],2)="01",LEFT('Marketing Snapshot'[DateStampMonth],4)-1&13,FORMAT('Marketing Snapshot'[DateStampMonth],"General Number"))