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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
basirve
Helper III
Helper III

Optimizing the code

Dear Experts,
Below code is taking more time,Could you please let me know any optimization technics on below code.

IF (
ISBLANK ( [_productivity] ) || ISBLANK ( [ProductivityGoalVal] ),
"",
IF ( VALUE ( [_productivity] ) >= VALUE ( [ProductivityGoalVal] ), "No", "Yes" )
)

Thanks & Regards,
Venkat
2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @basirve 

Have you solved this question with basirve's help? If you have solved the question, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.

If you need more help, please let me know.

 

Best Regards,

Community Support Team _Tang

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

Samarth_18
Community Champion
Community Champion

Hi @basirve ,

 

Before optimize it, I would suggest just have a look into these measure_productivity and ProductivityGoalVal  but still you can try below code:-

SWITCH (
    TRUE (),
    OR ( [_productivity], [ProductivityGoalVal] ), BLANK (),
    [_productivity] >= [ProductivityGoalVal], "NO",
    "YES"
)

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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