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

I need help on blanks instead of zeros in my calculations

Capture.PNG

Can 

GYM = AVERAGE('JMH'[GYM])

GYM ii = AVERAGE( 'General'[GYM])
GYM Results= CALCULATE(IF([GYM] >= 0, ['JMH' GYM], [GYM ii] ) )
 
Thank you
 
I have even tried this one too: 
GYM Results= if( [GYM ii] >=0, [GYM ii], if( [GYM] >=0, [GYM],  blank( ) )
1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Measures

avg1 = SUM('Table (3)'[cl2])/CALCULATE(COUNT('Table (3)'[cl1]),ALLEXCEPT('Table (3)','Table (3)'[cl1]))

avg2 = SUM('Table (4)'[cl2])/CALCULATE(COUNT('Table (3)'[cl1]),ALLEXCEPT('Table (3)','Table (3)'[cl1]))

Measure 5 = IF([avg1]>=0,[avg1],IF([avg2]>=0,[avg2],BLANK()))

Capture5.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Measures

avg1 = SUM('Table (3)'[cl2])/CALCULATE(COUNT('Table (3)'[cl1]),ALLEXCEPT('Table (3)','Table (3)'[cl1]))

avg2 = SUM('Table (4)'[cl2])/CALCULATE(COUNT('Table (3)'[cl1]),ALLEXCEPT('Table (3)','Table (3)'[cl1]))

Measure 5 = IF([avg1]>=0,[avg1],IF([avg2]>=0,[avg2],BLANK()))

Capture5.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , try like

GYM Results= if( [GYM ii] >=0, [GYM ii], if( [GYM] >=0, [GYM], 0 )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Amit,

I tried that too its not working.

az38
Community Champion
Community Champion

Hi @Anonymous 

try this rewritten sentence

GYM Results = 

VAR GYM = CALCULATE(AVERAGE('JMH'[GYM]))
VAR GYMii = CALCULATE(AVERAGE( 'General'[GYM]))

RETURN 
IF( GYM >= 0, GYM, GYMii)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

I am getting syntax errors 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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