Forum Discussion
Filter only highest value by category
- 9 years ago
Hi Anonymous,
You'd better create calculated columns to get the max sale for each group, then create a new table to display what you want. I try to reproduce your scenario and get expected result as follows.First, create a calculated column using the following formula.
Max = CALCULATE(MAX(Test[Sales]),ALLEXCEPT(Test,Test[Group]))
Then click the New table under Modeling, type the DAX and create a new table. Please the result in screenshot, the result table will refresh when your data refresh.
Expected result = SELECTCOLUMNS(FILTER(Test,Test[Sales]=Test[Max]),"Group",Test[Group],"Sales Person",Test[Sales Person],"highest",Test[Max])
If you have any other issue, please feel free to ask.
Best Regards,
Angelia
You're welcome.
The solution will be dynamic if you adjust the source to the actual source of your data.
Hi Anonymous,
You'd better create calculated columns to get the max sale for each group, then create a new table to display what you want. I try to reproduce your scenario and get expected result as follows.
First, create a calculated column using the following formula.
Max = CALCULATE(MAX(Test[Sales]),ALLEXCEPT(Test,Test[Group]))
Then click the New table under Modeling, type the DAX and create a new table. Please the result in screenshot, the result table will refresh when your data refresh.
Expected result = SELECTCOLUMNS(FILTER(Test,Test[Sales]=Test[Max]),"Group",Test[Group],"Sales Person",Test[Sales Person],"highest",Test[Max])
If you have any other issue, please feel free to ask.
Best Regards,
Angelia
- v-huizhn-msft9 years agoMicrosoft Employee
Hi Anonymous,
As I tested, when the resource data changes, the result table will update when I click the refresh.
Best Regards,
Angelia - Anonymous9 years agoNot applicable
Thank you very much. You saved my life. Will this second table will updated when my original table value changed. Is this dynamic solution?
Best, Kulchandra
- Anonymous9 years agoNot applicable
Thank you very much for all your help.
- tabbey8 years agoFrequent Visitor
Your example worked except when "group" is added to a slicer. When Radimetrics is selected, the max is showing 67 instead of 12. I'm new to dax. Any suggestion on how to fix this? I have been searching the web for few days but still to no avail.... Any helps is very appreciated!
Thanks,
TA
- tabbey8 years agoFrequent Visitor
Your example worked except when "group" is added to a slicer. When Radimetrics is selected, the max is showing 67 instead of 12. I'm new to dax. Any suggestion on how to fix this? I have been searching the web for few days but still to no avail.... Any helps is very appreciated!
Thanks,
TA
- Anonymous7 years agoNot applicable
Anonymous
I used this solution for a similar issue I was having. Everything works great until I want to use "Salesperson" as a slicer. Is there a way to insert a slicer from the original table that will filter out which are used in the DAX formula?
- harib7 years agoPost Patron
- Anonymous7 years agoNot applicable
Great solution for beginner user of DAX , thanks!
- Eti_SCM4 years agoRegular Visitor
Hi v-huizhn-msft,
Sorry for bringing this topic out from the crack.
How would it look like if antoher column would be added that always display the sales person associated to the max per group?
In this example, add a column with following values:
-Radimetrics ==>Ryan Reeve associated to each lines of this article
-Others ==> John Pace
-Medrad ==> Sean McMahan
Thanks a lot! - rsingh4 years agoFrequent Visitor
Hi
I have used the same codes and they are giving the desired result but when I deploy this report on D365 this table is not refreshed. Your early response is appreciated.