Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
New to Power BI and working with DAX Formulas. I'm trying to work with three formulas. The first would provide me with the customer that purchased the greatest amount of a part number during a specific year. I would like the second measure to filter out the results of the firs measure when selecting the customer that purchased the largest amount. I would like the third measue to filter out the first and second measures' results. This way, the matrix would show the top three customers to purchase a specific item. I have multiple part numbers listed in a matrix and the desired result is that it will show the top two for each part number without having to drill down into one specific part number for it to show.
NOTE: Measure #1 and #2 does not "Error out" and show the caution sign beside the metric. Only Measure #3 shows this. Measure #1 and #2 is shown as a monetary amount where I am trying to have them display the customer. Measure #2 also displays the same value as #1 so that is another issue. Any sugguestions on fixing what I have started with or suggestions on going a different direction? Code examples would be appreciated at this point! Thanks in advance for helping!
MEASURE #1
MEASURE #2
Solved! Go to Solution.
Hi @Anonymous,
Have you solved your problem?
If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If you still need help, please share some data sample and your desired output so that we could help further on it.
Best Regards,
Cherry
Hi @Anonymous,
Have you solved your problem?
If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If you still need help, please share some data sample and your desired output so that we could help further on it.
Best Regards,
Cherry
Hi there,
Maybe this will solve your problem, you will have to change the names of the columns and the measures. This measure will show the top 1 customer that bought the most in the current context. Hence, if you will put the part number in the matrix it should show the top 1 customer for each part, if the model is correctly connected. This will apply to the dates as well, i.e. top 1 customer for the dates in current context, you can override the context with a CALCULATE in the TOPN function, to filter on this year or the last.
Top 1 cust = PATHITEM( CONCATENATEX( TOPN( 3; 'Sales Customers'; [$ sales] ); 'Sales Customers'[CustomerName]; "|"; [$ sales];DESC ); 1 // Just changed this to 2 and 3 for the other measures )
If this solves your problem you please LIKE and accept this as solution.
Best regards,
Kristjan76
User | Count |
---|---|
139 | |
113 | |
103 | |
73 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |