Forum Discussion
Measure to include current selection and rows above and below dynamically
- 8 years ago
Hey Mark,
the pbix file attached to this post (I'm sorry for the confusion, but maybe I will stick to onedrive links instead of fileuploads because they do not update automatically :-)) now contains another unrelated table (Years unrelated).
Basically the change was not that big, instead of using the SUM OF ALL YEARS, now I use the AMOUNT OF THE SELECTED YEAR to determine the ranking.
There are two new measures:
- Selected Year
Just contains the value of the selected year - SUM Amount by Selected Year
Calculates the Amount for the selected year
I adjusted the measure "rank Countries", it now uses the measure "SUM Amount by Selected Year", I also added the "old" measure" this is now called "rank Countrires All Years" for comparison reasons, but is seems that the ranking for all years equals the ranking for one paricular year, maybe my calculation is wrong, or it's the data :-)
Please provide Feedback if my adjustments provide the solution you require, if not, can you please provide feedback, how to check this, based on the data you provided.
Regards,
Tom
- Selected Year
Hey Tom,
You sir are a genius! above and beyond what I was looking for! I thought you may have only set '2018' as the ranking year but I also now have the capability of switching the year for ranking quickly and easily. I've been struggling with that solution for months, clearly I have a lot more to learn with DAX.
Many Thanks,
Mark.
You are welcome!
It has been a pleasure!
Regards,
Tom
P.S.:
In the next days, I will create a blog post, where I will describe not just this solution but also some kind of "DAX" thinking :-)