Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
Solved! Go to Solution.
Hi @Antmkjr ,
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
Hi @Antmkjr ,
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
@Antmkjr , 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
I am sorry I didnt get this -", You have a simple calculation is power query and DAX both. What you need will decide that"
User | Count |
---|---|
63 | |
59 | |
56 | |
38 | |
29 |
User | Count |
---|---|
82 | |
62 | |
45 | |
41 | |
40 |