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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Measure to compute the ranking


Hi Experts

I'm trying use the below formula to get the ranking based on the qty. But not able to achieve the result as it is ending up in error.

 

Ranking = rankx(all('table1'[Account],'Mat'[Qty]),,Desc,DESC)

 

pic5.JPG

 

The 'Mat'[Qty] is not seen from the suggested list. The Qty is a column in the Mat table but we do have a measure called "Qty_Measure"(which is sum(Mat[Qty]). Neither "Qty_Measure" is seen to include in the formula.

 

Can someone please suggest.

 

Thanks
Mahad

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You can create a column rank, new column

 

Ranking = rankx('table1'[Account],'Mat'[Qty],,Desc,DESC)

 

when you want to measure rank you need a measure in expression

 

Ranking = rankx(all('table1'[Account],calculate(sum('Mat'[Qty])),,Desc,DESC)

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , You can create a column rank, new column

 

Ranking = rankx('table1'[Account],'Mat'[Qty],,Desc,DESC)

 

when you want to measure rank you need a measure in expression

 

Ranking = rankx(all('table1'[Account],calculate(sum('Mat'[Qty])),,Desc,DESC)

Anonymous
Not applicable

Hi Amitchandak

Thanks for your reply.

 

like I mentioned above. When I try to type the formula on the measure "Ranking", it is not suggesting me the "Qty_Measure" (which is a measure). In another word I cannot see "Qy_Measure" to complete the formula you have given.

 

Please suggest.

 

Thanks
Mahad

Hi @Anonymous 

 

Amit's measure should work. I have created a sample with it. You can download the attachment to see details. Note that there is a relationship between two tables based on Account column. 

vjingzhang_0-1657872612927.png

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.