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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
GAPER
Post Patron
Post Patron

If statement for calculation heavy functions

Hi all, 

 

I am trying to make a if statement like this

 

If (measure >1000, "n/m", measure)

However, in this case the i wonder if powerbi is doing the measure calculation 2 times which may significantly slower the run time.

 

Have been thinking to use Min(1000, Measure) but i would like to return the result "n/m" if the result is bigger than 1000

 

Thanks!

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

You can avoid calcualting the mesure twice by assigning it to a variable.

YourMeaures =
VAR _Amount = [Measure] 
RETURN IF ( _Amount > 1000, "n/m", _Amount )

View solution in original post

1 REPLY 1
jdbuchanan71
Super User
Super User

You can avoid calcualting the mesure twice by assigning it to a variable.

YourMeaures =
VAR _Amount = [Measure] 
RETURN IF ( _Amount > 1000, "n/m", _Amount )

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 Kudoed Authors