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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SandervdM
Frequent Visitor

What solution is preferred? Use VAR / RETURN or just one IF statement

Hi,

 

Trying to figure out which would works best in a measure. Not sure which code to use regarding performance, etc.  To me it seems that the "calculate_something()" needs to be executed twice if the outcome of the first is not blank. Anyone any ideas?

 

Measure = 

VAR n = calculate_something()

RETURN

IF( ISBLANK( n ), 0, n )

 

or:

 

Measure = 

IF( ISBLANK( calculate_something() ), 0, calculate_something() )

 

Or doesn't it make any difference at all?

 

Regards,
Sander

0 REPLIES 0

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors