Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Equivalent INNER JOIN query in DAX

I have this following query in TSQL :

SELECT
CustomerName,
SumOfSales
FROM (
SELECT
Customers.CustomerName,
SUM ( Sales.SalesAmount ) AS SumOfSales
FROM
Sales
INNER JOIN Customers
ON Sales.CustomerKey = Customers.CustomerKey
GROUP BY
Customers.CustomerName
) AS SubQuery
WHERE
SubQuery.SumOfSales > 100

I am working on Power BI and querying the table from SQL Server.
I want to create the same dax query to retrieve customers and total sales for only the customers who bought morethan 100 euros. How to do the INNER JOIN in Power BI ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

DAX uses an automatic LEFT OUTER JOIN in the query whenever you use columns related to the primary table :

EVALUATE
FILTER (
SUMMARIZE (
YourTable,
YourTable[CustomerName],
"TotalOver100", SUM ( Sales[SalesAmount] )
),
[TotalOver100] > 100
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading