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
Muneeb91
Regular Visitor

Using VAR and Return

Alarm & Efficiency % =
    VAR __Calc1 = [alarm percentage]
    VAR __Calc2 = [Efficiency %]
    VAR __Calc3 = ([Efficiency %]+[alarm percentage])/2

RETURN
        IF(ISBLANK(__Calc1), __Calc2)
 
Just need some help with the above please. I want to return Calc3, but if calc1 is showing blank I would like to return cal2
1 ACCEPTED SOLUTION
v-yinliw-msft
Community Support
Community Support

Hi @Muneeb91 ,

 

You can try this method:

 

Alarm & Efficiency % =

VAR __Calc1 = 'A&E'[AP]

VAR __Calc2 = 'A&E'[E]

VAR __Calc3 = ( 'A&E'[E] + 'A&E'[AP] ) / 2

RETURN

    SWITCH (

        TRUE (),

        ISBLANK ( __Calc1 ), __Calc2,

        ISBLANK ( __Calc2 ), __Calc1,

        NOT ( ISBLANK ( __Calc1 ) && ISBLANK ( __Calc2 ) ), __Calc3

    )

vyinliwmsft_0-1667290704647.png

 

 

Hope this helps you.

 

Best Regards,

Community Support Team _Yinliw

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

3 REPLIES 3
v-yinliw-msft
Community Support
Community Support

Hi @Muneeb91 ,

 

You can try this method:

 

Alarm & Efficiency % =

VAR __Calc1 = 'A&E'[AP]

VAR __Calc2 = 'A&E'[E]

VAR __Calc3 = ( 'A&E'[E] + 'A&E'[AP] ) / 2

RETURN

    SWITCH (

        TRUE (),

        ISBLANK ( __Calc1 ), __Calc2,

        ISBLANK ( __Calc2 ), __Calc1,

        NOT ( ISBLANK ( __Calc1 ) && ISBLANK ( __Calc2 ) ), __Calc3

    )

vyinliwmsft_0-1667290704647.png

 

 

Hope this helps you.

 

Best Regards,

Community Support Team _Yinliw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Shaurya
Memorable Member
Memorable Member

Hi @Muneeb91,

 

Use:

 

Alarm & Efficiency % =
VAR _Calc1 = [alarm percentage]
VAR _Calc2 = [Efficiency %]
VAR _Calc3 = ([Efficiency %]+[alarm percentage])/2

RETURN
IF(ISBLANK(_Calc1),_Calc2,_Calc3)

 

Works for you? Mark this post as a solution if it does!
Consider taking a look at my blog: Forecast Period - Graphical Comparison 

Thats great thank you. Is there also a way to do the same for cal2 also?
So if Calc1 is blank only return Calc2,
if Calc2 is blank only return Calc1,
and if neither Calc1 or Calc2 are blank return Calc3

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.