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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SCrowley
Frequent Visitor

Translate an excel formula with Nested IFs and ABS

The excel formula compares the previous row to the next row. I have substituted the Column Letters with Names for ease:

=IF(LaneCount2=1,"Sole",IF(OR(LaneCount2=2,LaneCount2=3),"Small",IFERROR(IF(AND(BaseQuartile2>BaseQuartile1,ABS(CumuPct2-(BaseQuartile1*25%))<ABS(CumuPct1-(BaseQuartile1*25%))),BaseQuartile1,BaseQuartile2),1)))

 

I have written a DAX measure but my logic is off and I'm not sure how to fix it: (*Note, I'd also like to format the Numbers returned with no decimals example pasted below DAX formula)

 

EFQ TEST =
VAR EQ2 = SWITCH([LANE COUNT],1,"Sole",2,"Small",3,"Small")
VAR BQX25 = [BASE QUARTILE]*0.25
 
VAR PREBQ = CALCULATE(
    [CUMULATIVE PCT],
    FILTER(
        ALLSELECTED('MOAR Q'[Lane ID]),
        ISONORAFTER('MOAR Q'[Lane ID], MAX('MOAR Q'[Lane ID]), DESC)
    )
)
VAR CPMINUS = PREBQ-BQX25

RETURN
IF(AND(EQ2 = blank(), PREBQ<BQX25),BQX25,EQ2)
 
EffQuartilePix.JPG
Thank you for your help.
0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors