Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have a situation in which I am ranking various metrics for 15 different stores. In addtion I also have three different reporting dates (the last day of each quarter), that are being chosen via a slicer.
I have created a calculated ranking for all stores for each metric.
The formula I am using is: RANKX(ALLEXCEPT(TABLE, REPORTING PERIOD), CALCULATE(SUM(METRIC)))
This formula is working great and is correct. However, there are several metrics that need to be ascending instead descending because a smaller value is actually better (If that particular store has the smallest value, then it would rank 1). When I change the formula to asc at the end, it then proceeds to rank from 31 -45 instead of 1-15, regardless of whichever time period I choose in the slicer.
Does anybody know how to correct this formula so that ascending will work? Thanks in Advance.
Solved! Go to Solution.
@Anonymous
Can you try the following pattern?
RANKX (
CALCULATETABLE ( ALLSELECTED ( table ), VALUES ( table[REPORTING PERIOD] ) ),
CALCULATE ( SUM ( Table[METRIC] ) )
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
This worked. Thank You, Kindly.
@Anonymous
Can you try the following pattern?
RANKX (
CALCULATETABLE ( ALLSELECTED ( table ), VALUES ( table[REPORTING PERIOD] ) ),
CALCULATE ( SUM ( Table[METRIC] ) )
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group