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
Need sample data to work with. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
That being said, you will need to have a disconnected country table and then use a measure. The measure will likely need a SUMMARIZE and then ADDCOLUMNS to add a RANKX column to rank. Then you will need something like EARLIER. Overall, a fairly complex calculation but definitely doable. But, sample data is key. (that can be copied and pasted)
Hi Greg,
Thanks for the posting tips and the quick reply :smileyhappy:, I have now edited to include a sample of the data I'm working with.
Regards,
Mark.