Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
AndersLearning
Frequent Visitor

Rankx - Summarized level

Hi All,

 

I've got order detail data that i would like to summarize on order level and the rank each order by size.

 

My data looks like this:

 

CompanyCode - CustomerCode - OrderNum - OrderLine - Product - Qty - Price

 

What i've done is create a measure called "Total Sales" = SUMX(OLine;OLine[OrderQty] * OLine[UnitPrice])

which gives me a sum for each line.

 

but some orders have many lines, and when i try to use the RankX function, it only ranks the lines by size. So i was wondering if there is a way of getting the rankx to look at each OrderNum and add up all OrderLines and then give me the ranks.

 

Thanks.

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @AndersLearning,

 

Can you share a dummy sample please? The trick could be the functions ALL, ALLEXCEPT, ALLSELETED.

 

Best Regards.

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, Sorry for the slow reply.

 

sampledata.PNG

Helpful resources

Announcements
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.