Forum Discussion
evalromf
9 years agoHelper I
AND IF in conditional column
Hi, I'm trying to create a new column that should be populated with a certain number based on the contents of several other columns. What I'm looking for is something like this: If [COUNT...
GilbertQ
7 years agoSuper User
Hi there
I would suggest instead of using a calculated column in the data model, do this in the Power Query Editor where you can use the Custom Column, where you can use multiple conditions.
here is my blog post explaining this: https://www.fourmoo.com/2018/11/27/multiple-conditions-for-a-conditional-column-in-power-query/
I would suggest instead of using a calculated column in the data model, do this in the Power Query Editor where you can use the Custom Column, where you can use multiple conditions.
here is my blog post explaining this: https://www.fourmoo.com/2018/11/27/multiple-conditions-for-a-conditional-column-in-power-query/
PowerBIBeginer
7 years agoHelper V
Hi,
On your solution, it is not written how to get custom column. I got it now, its difficult me to find that. Okk..
As now im trying in custom column, how do i mentioned this line-
IF[Cond1]="abc" and INT(24*[TAT excluding weekends_holidays])>8, then ">8Hrs" else if ...
INT(24*[TAT excluding weekends_holidays])>8 ??
Can i use INT above? Or directly like
IF[cond1]="abc" and 24*[TAT excluding weekends_holidays])>8 then ">8Hrs" else if ...
- PowerBIBeginer7 years agoHelper V
Hi, I do some random check.
When I'm using single if condition like-
Column = IF('For PwerBi'[Cert type for TAT]="Midterm Routine" && INT(24*'For PwerBi'[TAT excluding weekends_holidays])>8,">8Hrs","NA")im not getting an error and output comes.
But, When im adding one IF condition like-
Column = IF('For PwerBi'[Cert type for TAT]="Midterm Routine" && INT(24*'For PwerBi'[TAT excluding weekends_holidays])>8,">8Hrs",IF('For PwerBi'[Cert type for TAT]="Midterm Routine" && INT(24*'For PwerBi'[TAT excluding weekends_holidays])<8,INT(24*[TAT excluding weekends_holidays]),"NA"))it giving me an error - "Expressions that yield variant data-type cannot be used to define calculated columns."
I dont understand meaning of this error. Why it appears. Someone pls help me in this.