Forum Discussion
New Column
Hi all,
How do I create a column for the below which states:
- IF [HourlyOrShiftRate] = per day & Rate1PayRate >= 180
- || IF [HourlyOrShiftRate] = per hour & Rate1PayRate >= 18
- THEN Yes
- Else Blank
Hi HenryJS
= IF( OR([HourlyOrShiftRate] = "per day" && [Rate1PayRate] >= 180, [HourlyOrShiftRate] = "per hour" && [Rate1PayRate] >= 18), "Yes", BLANK() )?
3 Replies
- amitchandakSuper User
IF (([HourlyOrShiftRate] = "per day" && Rate1PayRate >= 180 ) || ( [HourlyOrShiftRate] = "per hour" & Rate1PayRate >= 18)
, "Yes", Blank()) - edhansCommunity Champion
HenryJS if you can, create this column in Power Query. It creates a native column in Power BI and is much more efficient. The formula would be:
if ([HourlyOrShiftRate] = "per day" and [Rate1PayRate] >= 180) or ([HourlyOrShiftRate] = "per hour" and [Rate1PayRate] >= 18) then "Yes" else nullIn general, try to avoid calculated columns. There are times to use them, but it is rare. Getting data out of the source system, creating columns in Power Query, or DAX Measures are usually preferred to calculated columns. See these references:
Calculated Columns vs Measures in DAX
Calculated Columns and Measures in DAX
Storage differences between calculated columns and calculated tables
Creating a Dynamic Date Table in Power Query