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

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

Reply
krishak77
Helper I
Helper I

Convert DAX from column to measure

Hello All,

 

Can anyone please provide DAX to apply in measure for the below DAX which is applied in Added Column.

 

FRSOTAT =
VAR CurrentRow = 'Distinct SOTAT'[Row_Number] // Replace 'YourTable' with the actual name of your table and 'Index' with your table's index column

 

VAR PreviousRowValueD = CALCULATE(MAX('Distinct SOTAT'[FRper]), FILTER('Distinct SOTAT', 'Distinct SOTAT'[Row_Number] = CurrentRow + 1))
VAR PreviousRowValueA = CALCULATE(MAX('Distinct SOTAT'[Sotat]), FILTER('Distinct SOTAT', 'Distinct SOTAT'[Row_Number] = CurrentRow + 1))

 

RETURN

 

IF(CurrentRow >=1 && 'Distinct SOTAT'[FRper] < 0.9 && PreviousRowValueD >= 0.9, 'Distinct SOTAT'[Sotat] + (PreviousRowValueA - 'Distinct SOTAT'[Sotat]) * (0.9 - ('Distinct SOTAT'[FRper])) / (PreviousRowValueD - ('Distinct SOTAT'[FRper])), 0

 )
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@krishak77 Try:

FRSOTAT =
VAR CurrentRow = MAX('Distinct SOTAT'[Row_Number]) // Replace 'YourTable' with the actual name of your table and 'Index' with your table's index column

VAR PreviousRowValueD = CALCULATE(MAX('Distinct SOTAT'[FRper]), FILTER('Distinct SOTAT', 'Distinct SOTAT'[Row_Number] = CurrentRow + 1))
VAR PreviousRowValueA = CALCULATE(MAX('Distinct SOTAT'[Sotat]), FILTER('Distinct SOTAT', 'Distinct SOTAT'[Row_Number] = CurrentRow + 1))

RETURN
IF(CurrentRow >=1 && 'Distinct SOTAT'[FRper] < 0.9 && PreviousRowValueD >= 0.9, 'Distinct SOTAT'[Sotat] + (PreviousRowValueA - 'Distinct SOTAT'[Sotat]) * (0.9 - ('Distinct SOTAT'[FRper])) / (PreviousRowValueD - ('Distinct SOTAT'[FRper])), 0


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @krishak77 ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Greg_Deckler
Community Champion
Community Champion

@krishak77 Try:

FRSOTAT =
VAR CurrentRow = MAX('Distinct SOTAT'[Row_Number]) // Replace 'YourTable' with the actual name of your table and 'Index' with your table's index column

VAR PreviousRowValueD = CALCULATE(MAX('Distinct SOTAT'[FRper]), FILTER('Distinct SOTAT', 'Distinct SOTAT'[Row_Number] = CurrentRow + 1))
VAR PreviousRowValueA = CALCULATE(MAX('Distinct SOTAT'[Sotat]), FILTER('Distinct SOTAT', 'Distinct SOTAT'[Row_Number] = CurrentRow + 1))

RETURN
IF(CurrentRow >=1 && 'Distinct SOTAT'[FRper] < 0.9 && PreviousRowValueD >= 0.9, 'Distinct SOTAT'[Sotat] + (PreviousRowValueA - 'Distinct SOTAT'[Sotat]) * (0.9 - ('Distinct SOTAT'[FRper])) / (PreviousRowValueD - ('Distinct SOTAT'[FRper])), 0


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.