• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Top 10 customer with total due

praveensc2021

New Member
hi all,

please let me know how can i write in dax

SELECT * FROM
(
SELECT YEAR(OrderDate) AS OrderYear,
Customerid,
sum(TotalDue) as TotalDue,
ROW_NUMBER() OVER(PARTITION BY YEAR(OrderDate) ORDER BY SUM(TOTALDUE) DESC) EN
FROM Sales.SalesOrderHeader
group by YEAR(OrderDate),CustomerID
) A WHERE EN<=10
 
Without knowing your data structure. We can't really help you.
DAX is highly context dependent language and different evaluation context will give different result.

I'd recommend uploading sample workbook with sanitized data, that's representative of your actual data structure. Along with manually crafted desired result.

I'm assuming that since you posted SQL query, that you want to use DAX to create calculated table? Also, it's important to note what tool you are using. In Excel data model, you can't use DAX to create calculated table
 
Back
Top