Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
soorajskn
Regular Visitor

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? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @soorajskn ,

Please add a index column first.

vcgaomsft_0-1682905227514.png

then add a custom colum.

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

vcgaomsft_1-1682906604583.png

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @soorajskn ,

Please add a index column first.

vcgaomsft_0-1682905227514.png

then add a custom colum.

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

vcgaomsft_1-1682906604583.png

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

soorajskn
Regular Visitor

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

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.