Forum Discussion

soorajskn's avatar
soorajskn
Regular Visitor
3 years ago
Solved

Convert excel formula to Power Query

I have below excel formula which needs to be replicated on power query 

 

AK – Concat (text)

E – Opened (Date)

Days between  =IF($AK2=$AK3,($E3-$E2),"")

 

Can someone explain me how this can be replicated? 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi soorajskn ,

    Please add a index column first.

    then add a custom colum.

    try
    (
    if PreviousStepName{[Index]+1}[Concat] = [Concat]
    then Number.From(PreviousStepName{[Index]+1}[Opened]-[Opened])
    else null
    )
    otherwise 
    null

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

2 Replies

  • soorajskn's avatar
    soorajskn
    Regular Visitor

     I am new to power query. Any who can help me with the above query please.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi soorajskn ,

    Please add a index column first.

    then add a custom colum.

    try
    (
    if PreviousStepName{[Index]+1}[Concat] = [Concat]
    then Number.From(PreviousStepName{[Index]+1}[Opened]-[Opened])
    else null
    )
    otherwise 
    null

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly --  How to provide sample data in the Power BI Forum