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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Convert excel (IF(ISERROR(AVERAGEIFS) to DAX

Can anyone have any suggestion for below excel formula to convert into a Dax? =IF(ISERROR(AVERAGEIFS('P'!$U$3:$U$2186,'P'!$H$3:$H$2186,'C'!$I2),"No" (***Tabsheet=P,C)

1 ACCEPTED SOLUTION

Hi @Anonymous

In Editor Queries

merge columns for table P (MAT, WORLD,LINE)

and for table C(MAT, PLANNING,LINE)

6.png

 

Then "apply&close", create a relationship between two tables

7.png

 

Finally create measures in Table P

sum = CALCULATE(SUM(P[UP]),FILTER(ALL(P),[Merged]=MAX(C[Merged])))

count = CALCULATE(COUNT(P[UP]),FILTER(ALL(P),[Merged]=MAX(C[Merged])))

average1 = [sum]/[count]

Or

Measure =
VAR sum1 =
    CALCULATE ( SUM ( P[UP] ), FILTER ( ALL ( P ), [Merged] = MAX ( C[Merged] ) ) )
VAR count1 =
    CALCULATE (
        COUNT ( P[UP] ),
        FILTER ( ALL ( P ), [Merged] = MAX ( C[Merged] ) )
    )
RETURN
    IF ( MAX ( P[Merged] ) = MAX ( C[Merged] ), sum1 / count1, "no trial" )

5.png

 

Best Regards

Maggie

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

 

 

You might as well show some data and the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish,

Please see below,

below excel fomula with column and tabsheet name

=IF(ISERROR(AVERAGEIFS(UP,MAT,MAT,WORLD,PLANNING,LINE,LINE)),"No"

(***Tabsheet=P,C)

>>>Dataset in Excel

Tasheet P

UP

MAT

WORLD

LINE

123

ABC

EMEA

AX

456

XYZ

ASA

LM

789

MNP

AME

AR

    

Tabsheet C

 

MAT

Planning

Line

 

ABC

ACD

AX

 

XYZ

KBC

LM

 

MNP

HKR

AR

 
Anonymous
Not applicable

Hi Ashish,

Please see below formula,

 

=IF(ISERROR(AVERAGEIFS('Prior Year'!$U$3:$U$2186,'Prior Year'!$H$3:$H$2186,'Current Year'!$I2,'Prior Year'!$X$3:$X$2186,'Current Year'!$C2,'Prior Year'!$F$3:$F$2186,'Current Year'!$F2)),"No AUP Avail",AVERAGEIFS('Prior Year'!$U$3:$U$2186,'Prior Year'!$H$3:$H$2186,'Current Year'!$I2,'Prior Year'!$X$3:$X$2186,'Current Year'!$C2,'Prior Year'!$F$3:$F$2186,'Current Year'!$F2))

 

Expected Result=59152

 

Prior Year Tabsheet
U3H3X3F3
91677A66528usapap
Current Year Tabsheet 
I2C2F2
B52521APACbmx

Hi @Anonymous

In Editor Queries

merge columns for table P (MAT, WORLD,LINE)

and for table C(MAT, PLANNING,LINE)

6.png

 

Then "apply&close", create a relationship between two tables

7.png

 

Finally create measures in Table P

sum = CALCULATE(SUM(P[UP]),FILTER(ALL(P),[Merged]=MAX(C[Merged])))

count = CALCULATE(COUNT(P[UP]),FILTER(ALL(P),[Merged]=MAX(C[Merged])))

average1 = [sum]/[count]

Or

Measure =
VAR sum1 =
    CALCULATE ( SUM ( P[UP] ), FILTER ( ALL ( P ), [Merged] = MAX ( C[Merged] ) ) )
VAR count1 =
    CALCULATE (
        COUNT ( P[UP] ),
        FILTER ( ALL ( P ), [Merged] = MAX ( C[Merged] ) )
    )
RETURN
    IF ( MAX ( P[Merged] ) = MAX ( C[Merged] ), sum1 / count1, "no trial" )

5.png

 

Best Regards

Maggie

Anonymous
Not applicable

Thank you so much Maggie & Ashish...Now it makes very clear to me.Thanks

Hi,

 

Using the query editor just merge the two queries


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi Ashish,

let me know if you need more information.

Thanks

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors