Forum Discussion
Filtering Table Values
- 4 years ago
Anonymous this will be table expression
Table 2 = var _grp = GROUPBY('Table','Table'[GUID],'Table'[LPGU],"subTotal by GUIDLPGU",SUMX(CURRENTGROUP(),'Table'[Order Value])) --var _filt = TOPN(1, FILTER(_grp,var _guid = [GUID] return [GUID]=_guid),[x],DESC) var _rank = SUMMARIZE(FILTER(ADDCOLUMNS(_grp, "rank", RANKX(FILTER(_grp,[GUID]=EARLIER([GUID])),[subTotal by GUIDLPGU],,DESC)),[rank]=1),[GUID],[LPGU],[subTotal by GUIDLPGU]) return _rankAlexisOlson in a table expression is it possible to ask TOPN to return TOPN(1) based on a partiton like in RANKX
RANKX(FILTER(_grp,[GUID]=EARLIER([GUID])I tried but failed.
Anonymous , Based on what I got, a measure to be used with GUID, LPGU in visual
sumx(summarize(Table, Table[GUID], Table[LPGU], "_sum", sum(Table[Order Value] ) ), [_sum])
Seems that doesn't work as it still fetches multiple values of LPGU, instead it must fetch single values of GUID, LPGU corresponding to Max Sum of Order Value as shown in the Result Table. Also I need to create Result Table as Data Table(not visual table).
- amitchandak4 years agoSuper User
Anonymous , Try like
sumx(summarize(Table, Table[GUID], "_sum", sum(Table[Order Value] ) ), [_sum])
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.- Anonymous4 years agoNot applicable
amitchandak This too doesn't work and I still can see multiple values of LPGU, GUID and Order Value.
It needs to go like Result Table Must show filtered GUID, LPGU and Maximum of Sum of Order Value and that Sum of Order Value must be done by LPGU.
Unfortunately, I can't present the sample data. You Can take data from the screenshot that I attached. Also keeping the data table here.
GUID LPGU Order Value G21 KRTG 4 G21 KRVC 3 G21 KRTG 6 G21 KRVC 3 G21 KRPP 5 G65 KPIC 1 G65 KPIC 4 G65 KKRD 6 G65 GHCI 7 G65 GHCI 5 G76 TTCG 5 G76 TTRS 1 G76 TTDS 8 G76 TTCG 5