Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a report with a time slicer so the user can find the Top 5 operators for the time period, and see the values for each of those top 5 and "Other" in a chart below. The Top5 and other DAX I found online seems to work over the whole slicer period; however, when I use it in a chart that's split by month, the Top5 and other is calculated per month, resulting in more than 5 members in the legend (since there's a different Top5 for each month).
What I want to do is create a set of the Top 5 and Other operators for the time period selected on the slicer (which will change), yet have that same set show per month in the chart. I've included a screenshot of the problem and the DAX I'm using for the Top5 and other. Can you help me with how to define this "set" so it will work correctly in the chart?
https://www.dropbox.com/s/56uer1dy5yop1b8/top5%20and%20other%20illustration%20of%20problem.JPG?dl=0
https://www.dropbox.com/s/c4x07huscdt2zz4/the%20working%20top5%20and%20other%20DAX.txt?dl=0
try appending var top5 by adding ALL(DATETABLE) to the end like this
var top5 = CALCULATETABLE(TOPN(5,VALUES(DisposalWell[OperatorName]),CALCULATE(SUM(WellCompletionInjection[ProductionAmount]),ALL(DATETABLE))))
User | Count |
---|---|
42 | |
28 | |
24 | |
20 | |
16 |
User | Count |
---|---|
54 | |
35 | |
18 | |
18 | |
15 |