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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi there,
I am, for the first time, using RANKX for reporting different data both in a descending and an ascending way.
I've had no issues with DESC, but for some reason ASC always starts at 2. It seems that everything else that's in my DimBusiness table, that I'm not interested in/is filtered out, becomes a 1. I don't know how to manage it. Obviously my filters are wrong.
I'm using this:
Ranking Ave =
RANKX( ALL(DimBusiness[BusinessName]), CALCULATE( [Weighted Ave],
KEEPFILTERS( DATESBETWEEN( Dim[CalendarDate], [ReportingStartDate], [ReportingEndDate] ) ) ),
, ASC, DENSE )
Others have had the same issues, but I can't wrap my head around it. Help much appreciated.
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but please try something like below.
Ranking Ave =
VAR _t =
FILTER ( ALL ( DimBusiness[BusinessName] ), ( NOT [Weighted Ave] = 0 ) )
RETURN
RANKX (
_t,
CALCULATE (
[Weighted Ave],
KEEPFILTERS (
DATESBETWEEN ( Dim[CalendarDate], [ReportingStartDate], [ReportingEndDate] )
)
),
,
ASC,
DENSE
)
Hi,
I am not sure if I understood your question correctly, but please try something like below.
Ranking Ave =
VAR _t =
FILTER ( ALL ( DimBusiness[BusinessName] ), ( NOT [Weighted Ave] = 0 ) )
RETURN
RANKX (
_t,
CALCULATE (
[Weighted Ave],
KEEPFILTERS (
DATESBETWEEN ( Dim[CalendarDate], [ReportingStartDate], [ReportingEndDate] )
)
),
,
ASC,
DENSE
)
This seems to have worked. Thanks very much.
Are you able to explain what the issue was?
Hi,
I tried to create a virtual table, inside the measure, that does not contain zero value of [Weighted Ave]. And then, I tried to rank among the virtual table.
If you want to change the condition, you can try altering the below part.
VAR _t =
FILTER ( ALL ( DimBusiness[BusinessName] ), ( NOT [Weighted Ave] = 0 ) )
I hope this explains.
Thank you.
Hi @greenskmachine2 ,
the reason could be the presence of blank values in your measure [Weighted Ave]. please share sample data if possible
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.