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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to convert an excel formula to DAX language

Hello,

could I get some help on how to convert following Excel formala to Dax?

=IF(C2=C1;E1+1;1)

 

Here is a matrix table with the formula:

tyankata_0-1614774890948.png

 

Any help is greatly appreciated!

 

Regards,
Stoyan

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

maybe you can try this

1. add an index column in PQ

11.png

2. use DAX to create a column

Column = RANKX(FILTER('Table','Table'[surveykey]=EARLIER('Table'[surveykey])),'Table'[Index],,ASC)

2.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@Anonymous 

maybe you can try this

1. add an index column in PQ

11.png

2. use DAX to create a column

Column = RANKX(FILTER('Table','Table'[surveykey]=EARLIER('Table'[surveykey])),'Table'[Index],,ASC)

2.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




StefanoGrimaldi
Resident Rockstar
Resident Rockstar

hey, theres not direct way to replicate a excel formula sinces DAX function different , its column, row based evaluation instead of a per cell evaluation as excel. 

 

what you can do its learn a little dax and them add a index column and write a dax that compare a row for column value with that same row index -1 (previus entrey) or any other column you could us as hitorical entry reference. 





Did I answer your question? Mark my post as a solution! / Did it help? Give some Kudos!

Proud to be a Super User!




Anonymous
Not applicable

is it EARLIER function that should be used?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.