Forum Discussion
Craig_01
2 years agoHelper I
Create Custom Column using an IF Statement based on two columns
Hi All, I have a dataset, that contains numerous columns of data, but main ones are: Columns: Branch Status Despatch Date Requested Date Promised Date I want to calculate the differe...
- 2 years ago
Craig_01 , Try using below formula for new calculated column
Difference = IF('Table'[Branch] = "York" && 'Table'[Status] = "Out", DATEDIFF('Table'[Despatch Date], 'Table'[Requested Date], DAY), DATEDIFF('Table'[Despatch Date], 'Table'[Promised Date], DAY) ) - Anonymous2 years ago
Thanks for the reply from bhanu_gautam , please allow me to provide another insight:
Hi Craig_01 ,Here are the steps you can follow:
1. Add Column – Custom Column.
2. Enter code.
if [Branch]="Your" and [Status] ="Out" then Duration.Days([Despatch Date] - [Requested Date]) else Duration.Days([Despatch Date] - [Promised Date])3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Anonymous
2 years agoNot applicable
Thanks for the reply from bhanu_gautam , please allow me to provide another insight:
Hi Craig_01 ,
Here are the steps you can follow:
1. Add Column – Custom Column.
2. Enter code.
if [Branch]="Your" and [Status] ="Out"
then Duration.Days([Despatch Date] - [Requested Date])
else Duration.Days([Despatch Date] - [Promised Date])
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Craig_01
2 years agoHelper I