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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
emveha
Resolver III
Resolver III

rankx for product

Hi

Want to create a measure with the TOPX items based on the invoiced quantity, as an example; product 1 = invoiced qty=10, prod 2=inv. qty 40, prod 3=inv qty 35. So based on what i want to see, this should be the result:

Prod 2=1

Prod3=2

Prod1=3

My formula looks likes this: Top N = RANKX(ALL('Product'[Product Code]); SUMX(RELATEDTABLE(Sales); Sales[QuantityN])) 

Besides the fact that it takes a long time to execute this script, i don t get the result as i expected, in fact i only 1 as a result.

So my result looks like this: prod 1=invoiced qty=40, top N=1, prod2=inv qty=10, top N=1, prod3 =inv qty=500 top N=1.....

Any ideas what i am doing wrong and what needs to be changed...

thanks a lot!!

M

 

1 ACCEPTED SOLUTION
emveha
Resolver III
Resolver III

found the issue, and it works now (in my query i had product plus product name but in my topN script I forgot to add the product name....)

 

View solution in original post

1 REPLY 1
emveha
Resolver III
Resolver III

found the issue, and it works now (in my query i had product plus product name but in my topN script I forgot to add the product name....)

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.