Forum Discussion
Syntax issue with TOPN argument TABLE
I have a measure which retrive name of category which has max [Change] value. I'd like to add another dimension to that - not only category, but also a gender and filter it to be female. so for instance out of gender (female), category 2 has max value, so output should be: category2
TOP cat name =
it gives me name associated with max value when it concerns only one dimension - category. I'd like to add filter context of gender and only females Tried to ADDCOLUMNS inside TOPN but it didnt work.
Perhaps it should have other approach? Any ideas and tips are welcome
I've resolved my problem by using formula
CALCULATE( MAX(FctTable[Category]), TOPN(1, FILTER( SUMMARIZE (FctTable, FctTable[Gender], FctTable[Category], "@Chng", [Change]), FctTable[Gender] = "Female"), ABS([Change])) )
3 Replies
- amitchandakSuper User
Pbiuserr , Not very clear, check if one of the two can help
calculate(max(FctTable[Category]) ,TOPN(1,allselected(FctTable[Category]),[Change]), values(FctTable[Category]))
or
calculate([Change] ,TOPN(1,allselected(FctTable[Category]),[Change]), values(FctTable[Category]))
- PbiuserrPost Prodigy
Hi Amit
I'd like to create such table virtually and retrive "Category" with max value for gender = "Female". "Change" is a measure, not column if it helps- PbiuserrPost Prodigy
I've resolved my problem by using formula
CALCULATE( MAX(FctTable[Category]), TOPN(1, FILTER( SUMMARIZE (FctTable, FctTable[Gender], FctTable[Category], "@Chng", [Change]), FctTable[Gender] = "Female"), ABS([Change])) )