Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Solved! Go to Solution.
Hi, @llealsantos
You can do this by using this MAXX function to iterate through the cycles and find the maximum ranking. You can do this by modifying the metric in the following ways:
Measure 2 =
VAR Periods = ALL('Calendar'[Year Period])
VAR Total = [Laundry]
VAR Ranking = RANKX(Periods, [Laundry], Total, DESC)
// Calculate the maximum rank
VAR MaxRank =
MAXX(
Periods,
RANKX(Periods, [Laundry], [Laundry], DESC)
)
// Determine the result based on the rank
VAR Result =
IF(
Total = 0,
0,
IF(
Ranking <= 5,
1,
IF(
Ranking <= (MaxRank - 2), // Top 3 values
2,
0
)
)
)
RETURN
Result
Best Regards,
hackcrr
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @llealsantos
You can do this by using this MAXX function to iterate through the cycles and find the maximum ranking. You can do this by modifying the metric in the following ways:
Measure 2 =
VAR Periods = ALL('Calendar'[Year Period])
VAR Total = [Laundry]
VAR Ranking = RANKX(Periods, [Laundry], Total, DESC)
// Calculate the maximum rank
VAR MaxRank =
MAXX(
Periods,
RANKX(Periods, [Laundry], [Laundry], DESC)
)
// Determine the result based on the rank
VAR Result =
IF(
Total = 0,
0,
IF(
Ranking <= 5,
1,
IF(
Ranking <= (MaxRank - 2), // Top 3 values
2,
0
)
)
)
RETURN
Result
Best Regards,
hackcrr
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.