Forum Discussion
maciabit
2 years agoFrequent Visitor
Help! Best by category dinamically using DAX (.pbix attached)
Hello everyone!
I am asking for your help because, despite searching, I cannot find a way to create this DAX function. I uploaded here a .PBIX FILE EXAMPLE.
Simplified version of the problem follows.
I'm in this situation:
And want to obtain this:
I have a table containing store, category and a mymeasure (a measure).
For each category I need to find the best store. The calculation of the best store must be dynamic on the selected month, but must not consider any filters on the category or store.
I was able to calculate the value the best measure of that category. This is how i made value_highest_in_category:
value_highest_in_category =
CALCULATE(
MAXX(
SUMMARIZE('Data', 'Data'[store], "myMeasure", [measure]), [measure]
),
ALLEXCEPT('Data','Data'[month]), 'Data'[category] = MAX('Data'[category])
)
but I just can't extract the name of the corresponding store.
I thank anyone who can help me!
- Measure 2 = VAR _vm=[value_highest_in_category] RETURN MAXX(FILTER(ALL(Data[store]),[measure]=_vm),'Data'[store])
2 Replies
- wdx223_Daniel
Community Champion
Measure 2 = VAR _vm=[value_highest_in_category] RETURN MAXX(FILTER(ALL(Data[store]),[measure]=_vm),'Data'[store])- maciabitFrequent Visitor
Thank you so much!