Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I'm trying to create a measure to find the ranking of the previous year from the year selected by one of my slicers. Would be great if this was dynamic as the data is going to be a rolling five years however if i can't that's not a huge issue. I have this currently but I don't think it is getting the distinct rank and is adding up the ranks for the specific think over all the years.
Solved! Go to Solution.
From the look of your code, your TIMERANGE is not a date column. Change it to whole number then try:
Last Year Rank = var _SelectedYear = selectedvalue(scorecard[TIMEFRAME_RANGE]) RETURN CALCULATE( SUM(scorecard[RANKING]), scorecard[TIMEFRAME_RANGE] = _SelectedYear -1 )
Appreciate your Kudos
Connect with me!
Stay up to date on
Read my blogs on
Did I answer your question? Mark my post as a solution! Proud to be a Super User!
Connect with me!
Stay up to date on
Read my blogs on
Have you tried sampleperiodlastyear https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax
I tried this but it doesn't work (function previousyear has been used in a true/false expression that is used as a table filter expression. this is not allowed.)
From the look of your code, your TIMERANGE is not a date column. Change it to whole number then try:
Last Year Rank = var _SelectedYear = selectedvalue(scorecard[TIMEFRAME_RANGE]) RETURN CALCULATE( SUM(scorecard[RANKING]), scorecard[TIMEFRAME_RANGE] = _SelectedYear -1 )
Appreciate your Kudos
Connect with me!
Stay up to date on
Read my blogs on
Did I answer your question? Mark my post as a solution! Proud to be a Super User!
Connect with me!
Stay up to date on
Read my blogs on
Thanks Steve, looks like I just need to correct the format as the timeframe_range column is text, not numeric.
Last Year Rank = var _SelectedYear = selectedvalue(scorecard[TIMEFRAME_RANGE]) RETURN CALCULATE( SUM(scorecard[RANKING]), scorecard[TIMEFRAME_RANGE] = _SelectedYear -1 )
Appreciate your Kudos
Connect with me!
Stay up to date on
Read my blogs on
Did I answer your question? Mark my post as a solution! Proud to be a Super User!
Connect with me!
Stay up to date on
Read my blogs on
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |