topn customer
4 TopicsTopN dax function is not working
Hello guys, This is the problem I'm having right now while extracting Top 10 customers. You see the image, it's not showing proper value. here is my dax function. Top 10 customers = CALCULATE([Total Sales], TOPN( 10, DimCustomer, DimCustomer[FirstName], ASC))Solved1.8KViews0likes4CommentsHow to get the penultimate order date per customer from order data
Hi Guys, I want to ask how to take out the penultimate order date of each customer,I have tried using the following formula,but doesn't work penultimate order date= CALCULATE( MIN('order'[Order Date], TOPN( 2, 'order', 'order'[Order Date] ) )) thanks for all the tips and help @!Solved1.7KViews0likes7CommentsTopN Customers by Revenue filtered by Region, Country and, Reporting Unit
Hi, I m new to DAX and Power BI and not able to make out reason for inconsistent result. There are slicers for Region, Country and, Reporting Unit in Power BI report and I need to show top 5 customers from TodaysTable data based on the selection made. Table structure: HistoryTable - with Region, Country, Reporting Unit, Revenue, & CombinationKey (REG + COUNTRY + RU) TodaysTable - with Region, Country, Reporting Unit, Customer, Customer ID, Revenue & CombinationKey (REG + COUNTRY + RU) MapTable - Active Relationship, Both directions on CombinationKey - DISTINCT(ALL(HistoryTable [CombinationKey], HistoryTable [Region], HistoryTable [RU], HistoryTable [Country])) I created 2 Measures in TodaysTable Todays Revenue = SUMX(TodaysTable , TodaysTable [Net Order Value]) Rank of Customer = RANKX(ALLSELECTED(TodaysTable [Customer]),[Todays Revenue],,DESC,DENSE) and applied filter Rank of Customer <=5 in the report. While this shows the result correctly when I have only Customer and Todays Revenue as columns in the table. However, if I include Customer ID/ Region/ Country number of results shown just multiplies and I noticed that the Rank is repeating (multiple rows shows up as having Rank 1 while having different Revenues !!!) . I m unable to understand this behavior. It would be nice if someone could help me with correct DAX expression. that would enable me to show only 5 customers based on max revenue with additional fields (Region, Country, Customer ID). Also, I would like to know if this can be achieved with a single DAX expression. Thanks in advance.Solved5KViews0likes1Comment