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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
GeorgeColl
Helper II
Helper II

Best practice for adding a field to model

I am looking to rebuild a previous model that I have been working on for a while and would like to improve the performance, tidy it up and generally do things in a more 'Correct' manner.

 

Therefore, I'm writing an SQL query to my data source to build most of my table. My question is, I have conditional columns that I create so that I can use them for filtering (for example, a key for the banding of a numeric field) - should I be creating these as columns in my SQL query, and creating the table in PBI with a relationship for filtering. Or, would it be better to use a DAX measure?

1 ACCEPTED SOLUTION
sanalytics
Super User
Super User

@GeorgeColl 
Below is the thumb rule of creating any robust, optimized data model.
Data should be transformed as far upstream as possible, and as far downstream as necessary.
it is Roche's Maxim Data transformation law..
it simply says that if you think you can create any conditional column or measure calculation into the source. then Please go ahead.DO NOT HESITATE.
in you case, if you think you can do the calculation in Power query level, please do that.On the other hand, if you think the you can create the calculation in the SQL level rather than Power query level..Please do that..
trust me, it will make your life eaiser.
Bonus Tip : User Query folding.

Hope this will help you.

Regards,
sanalytics

 

 

View solution in original post

2 REPLIES 2
sanalytics
Super User
Super User

@GeorgeColl 
Below is the thumb rule of creating any robust, optimized data model.
Data should be transformed as far upstream as possible, and as far downstream as necessary.
it is Roche's Maxim Data transformation law..
it simply says that if you think you can create any conditional column or measure calculation into the source. then Please go ahead.DO NOT HESITATE.
in you case, if you think you can do the calculation in Power query level, please do that.On the other hand, if you think the you can create the calculation in the SQL level rather than Power query level..Please do that..
trust me, it will make your life eaiser.
Bonus Tip : User Query folding.

Hope this will help you.

Regards,
sanalytics

 

 

That's excellent thanks

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.