Forum Discussion
Calculated columns to a direct query source
What are the alternatives of adding calulated column to a direct query source,
I understand it can be done using power query, but the logic is slightly complicated to do in power query.
- Anonymous5 years ago
Hi Anonymous ,
This is not possible.
With calculated columns, you can add new data to a table already in your model. But instead of querying and loading values into your new column from a data source, you create a Data Analysis Expressions (DAX) formula that defines the column's values, after the model content is imported into the memory, the result of the DAX expression is calculated, and the Power Query calculated column is an M expression, which defines the transformation applied to the data source before the table is imported into the data model.
You can take a look at the following articles, apart from the differences in the languages used to create them, there are other differences between them:
https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-calculated-columns
http://radacad.com/m-or-dax-that-is-the-question
https://www.sqlbi.com/articles/comparing-dax-calculated-columns-with-power-query-computed-columns/
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
3 Replies
- amitchandakSuper User
Anonymous , You have a simple calculation is power query and DAX both. What you need will decide that.
Another way is line level calculation in measure using sumx, minx, maxx etc
few possible stuff is covered under this series
https://www.youtube.com/watch?v=My0bLn9voo4&list=PLPaNVDMhUXGbKatyDdOhGbTL3xW2Xy6pA
- AnonymousNot applicable
I am sorry I didnt get this -", You have a simple calculation is power query and DAX both. What you need will decide that"
- AnonymousNot applicable
Hi Anonymous ,
This is not possible.
With calculated columns, you can add new data to a table already in your model. But instead of querying and loading values into your new column from a data source, you create a Data Analysis Expressions (DAX) formula that defines the column's values, after the model content is imported into the memory, the result of the DAX expression is calculated, and the Power Query calculated column is an M expression, which defines the transformation applied to the data source before the table is imported into the data model.
You can take a look at the following articles, apart from the differences in the languages used to create them, there are other differences between them:
https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-calculated-columns
http://radacad.com/m-or-dax-that-is-the-question
https://www.sqlbi.com/articles/comparing-dax-calculated-columns-with-power-query-computed-columns/
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly