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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
JamesJarman22
New Member

Difference between Power Query and Modeling in Power BI

Hi All,

Relatively new to Power BI and Query here and having some issues with creating new columns. I thought that all column creation would be done in Power Query and this would then update across to Power BI. However, for some reason simple date calculations are just not working in PQ but work fine when I create them in the modeling tab on PB. I cannot understand the difference between the two other than the languages for functions seems very different (DAX maybe??).

 

Can anybody help me understand the differences between the two and what the pros and cons are for creating new columns in PB vs PQ please? If Power QUery is the answer why is a simple function to check to see if a date is in the future or the past (based on todays date) not working...? I have a date field (called Date) and am trying to build a simple if statement.


Really appreciate any help you can provide.

 

Thank you


James

2 ACCEPTED SOLUTIONS
dax
Community Support
Community Support

Hi @JamesJarman22 , 

According to your description, it seems that you want to know the difference between M code and DAX, right?

As I know, power query is better for model data (clean, transform etc.) but DAX is better for calculations (specially for measures which don't take a lot of ram when you’re doing massive computations). You could refer to M or DAX? That is the Question!  for details.

Best Regards,
Zoe Zhi

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

View solution in original post

edhans
Community Champion
Community Champion

To compare dates to today in Power Query, use the following example in a custom column:

 

 = if [Stuff] > DateTime.Date(DateTime.LocalNow()) then true else false

 

 

[Stuff] is my date field, and this returns TRUE if it is in the future, otherwise FALSE.

 

DateTime.LocalNow() is equivalent to NOW() in Excel. DateTime.Date() just strips out the time, making it equivalent to TODAY()

As a rule you should use custom columns in Power Query vs Calculated Columns in the DAX model. Calculated Columns are calculated at query refresh and generally do not compress. You can read more about it here. Custom columns from Power Query are treated by DAX as a native column and it is optimized for this.

When possible, do all modeling in Power Query, and this includes the addition of more columns than your data source has. There are some exceptions to this, but they are pretty rare. For example, there are some instances where a fairly complex DAX function in a Calculated Column can be faster or more efficient than doing it in a Measure, and the calculation simply isn't possible in Power Query. Again, fairly rare. I always try to do it in PQ first.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

2 REPLIES 2
edhans
Community Champion
Community Champion

To compare dates to today in Power Query, use the following example in a custom column:

 

 = if [Stuff] > DateTime.Date(DateTime.LocalNow()) then true else false

 

 

[Stuff] is my date field, and this returns TRUE if it is in the future, otherwise FALSE.

 

DateTime.LocalNow() is equivalent to NOW() in Excel. DateTime.Date() just strips out the time, making it equivalent to TODAY()

As a rule you should use custom columns in Power Query vs Calculated Columns in the DAX model. Calculated Columns are calculated at query refresh and generally do not compress. You can read more about it here. Custom columns from Power Query are treated by DAX as a native column and it is optimized for this.

When possible, do all modeling in Power Query, and this includes the addition of more columns than your data source has. There are some exceptions to this, but they are pretty rare. For example, there are some instances where a fairly complex DAX function in a Calculated Column can be faster or more efficient than doing it in a Measure, and the calculation simply isn't possible in Power Query. Again, fairly rare. I always try to do it in PQ first.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
dax
Community Support
Community Support

Hi @JamesJarman22 , 

According to your description, it seems that you want to know the difference between M code and DAX, right?

As I know, power query is better for model data (clean, transform etc.) but DAX is better for calculations (specially for measures which don't take a lot of ram when you’re doing massive computations). You could refer to M or DAX? That is the Question!  for details.

Best Regards,
Zoe Zhi

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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