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 dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello there,
Before I come here and ask this question. I asked chatgpt 3.5 to answer my question and I didn't like its answer.
Suppose we have a basic sql query here below:
SELECT
bt.file_hash,
bt.project_code,
(y.cat1_cost - bt.cat1_cost ) / bt.cat1_cost AS variance_cat1_cost
FROM
bluetable as bt
INNER JOIN yellowtable as y
ON bt.file_hash = y.file_hash and bt.cat10 = y.cat10
GROUP BY
bt.file_hash,
bt.project_code
and I get this answer below:
EVALUATE
SUMMARIZECOLUMNS (
bt[file_hash],
bt[project_code],
"variance_cat1_cost",
DIVIDE ( (SUM ( y[cat1_cost] ) - SUM ( bt[cat1_cost] )), SUM ( bt[cat1_cost] ))
)
and it says you don't have to specificy join condition because power bi it's based on common columns.
I doesn't make any sense, this is my join and that's how I get unique records.
Can someone explain me or guide me how I can create a calculated table with dax with aggregation included?
any video, link or code please.
Thanks!
Solved! Go to Solution.
@jgeddes Sorry for late response, I went with sql query so that I couldn load any way that I wanted.
However, we could do distinct column (mutual) to create a table and adding other columns with RELATED function to find corresponding value on the second table, so that I could use this as completing the third table.
These two article are helpful to get the columns you like and join them together, but in my case I needed to do something different.
Edit: I found this article, I believe if I digged into this I could've found my solution on your approach as well.
https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/
Thanks again!
@jgeddes Sorry for late response, I went with sql query so that I couldn load any way that I wanted.
However, we could do distinct column (mutual) to create a table and adding other columns with RELATED function to find corresponding value on the second table, so that I could use this as completing the third table.
These two article are helpful to get the columns you like and join them together, but in my case I needed to do something different.
Edit: I found this article, I believe if I digged into this I could've found my solution on your approach as well.
https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/
Thanks again!
The answer you got would rely on a relationship being in place between the two tables.
Here is a link to an article that explains join functions in DAX.
https://www.sqlbi.com/articles/using-join-functions-in-dax/
and a link to the NATURALINNERJOIN DAX function
https://learn.microsoft.com/en-us/dax/naturalinnerjoin-function-dax
Hope this gets you pointed in the right direction.
Proud to be a Super User! | |
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |