Forum Discussion
Adding a TOPN Filter to a Measure
- 4 years ago
Here is a more accurate representation that also works on line level.
SU Top10 = var mw = MAXX(all(Weekly),[YYYYWW]) var ft = filter(all(Weekly),[YYYYWW]=mw) var ms = SUMMARIZE(ft,[Short Name] ,"s",sum([Sales Units])) var tt = SELECTCOLUMNS(TOPN(10,ms,[s]),"Widget",[Short Name]) var mc = SUMMARIZE(Weekly,[Short Name] ,"s",sum([Sales Units])) var mf = filter(mc,[Short Name] in tt) return sumx(mf,[s])
That makes it easier to calculate but it will be more confusing for your users. make sure to add wordage to the page explaining what they are looking at.
Now you would need to define what you mean by "current week".
Current week = Index_Week 1
or MAX(YYYYWW)
- lbendlin4 years agoSuper User
your data will fluctuate wildly on the first few days of that week. Not sure this brings your business much insights. Are you planning for import mode or direct query mode?
- LUCASM4 years agoHelper IV
Hi
The data is a single import from a third party data suppler each week so there will not be any flutuation - unless there is a data error and a new file is sent, which has never happened....yet.
The pbix uses Import Mode and a refresh schedule is set for every Day - to allow for Bank holidays, the supplied data set gets uploaded late or a new corrected data set is sent.
- lbendlin4 years agoSuper User
Something like this ?