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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Gerardinho82
New Member

How to convert this formula from excel to Dax

Hello good afternoon everyone, someone who could help me transform this excel formula that works correctly in excel, but I don't have the necessary knowledge in dax to be able to transport it, that value must be given in the last column, thank you very much support

 

=SI((E3-E2) < 0,( (E3) /30), ( SI((A3<> A2), ((E3-E2) / 720),(E3-E2)/30))) (2nd row)

=SI((E4-E3) < 0,( (E4) /30), ( SI((A4<> A3), ((E4-E3) / 720),(E4-E3)/30))) (3th row)

and so on

 

tabla excel 1.pngtabla excel 2.png

 

 

2 REPLIES 2
Gerardinho82
New Member

the issue is that, in excel if I can put E3, referring to column E line 3, how do I do that in powerbi, because I can't say column E line 2, or yes?, that's what I don't know how to do, how to indicate line 2 or 3 or 4

Sharma_Yash
Frequent Visitor

Hello @Gerardinho82 ,
Try the following code which is converted from excel to dax.
-For 2nd row:-
= IF(

   (E3 - E2) < 0,

       E3 / 30,

   IF( A3 <> A2,

   (E3 - E2) / 720,

(E3 - E2) / 30

)

)

 

-For 3rd row:-

= IF(

(E4 - E3) < 0,

E4 / 30,

IF(

A4 <> A3,

(E4 - E3) / 720,

(E4 - E3) / 30

)

)

 

-If you get the desired solution,then approve it as the solution.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.