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
campelliann
Post Patron
Post Patron

If condition vs merge (which is better for performance)

Hi,

 

I have a very simple thing to do on Powerquery which is basically for each month of the Year to write a "weighted" working days. And I just added a custom column like below. But is this a "Best practice" or would it be better performance wise to just create a table with the months name/weighted days and then merge with with main table?

Thanks

= Table.AddColumn(#"Filtered Rows", "Custom", each if Date.Month([Month]) =1 then 19.5 else if Date.Month([Month]) =2 or Date.Month([Month]) =4 or Date.Month([Month]) =7 or Date.Month([Month]) =12 then 17.5 else if Date.Month([Month]) =5 then 21.5 else if Date.Month([Month]) =6 then 16.5 else if Date.Month([Month]) =8 then 15.5 else if Date.Month([Month]) =3 or Date.Month([Month]) =11 then 20.5 else if Date.Month([Month]) =10 then 18.5 else 0)

1 ACCEPTED SOLUTION
daXtreme
Solution Sage
Solution Sage

I don't think there is something like Best Practices in Power Query. If you have several ways to do things, you have to test. This is general in programming, even though some languages do have something like Best Practices (for instance, Python, but even there you have to test different approaches).

View solution in original post

1 REPLY 1
daXtreme
Solution Sage
Solution Sage

I don't think there is something like Best Practices in Power Query. If you have several ways to do things, you have to test. This is general in programming, even though some languages do have something like Best Practices (for instance, Python, but even there you have to test different approaches).

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.