Forum Discussion
RANKX Measure issue
The problem is that I have a top 10 measure with rankx:
Top Clientes =
VAR
Prod = [Mas Vendido]
VAR
Cliente = VALUES(Clientes[CompanyName])
RETURN
CALCULATE([Ventas Total];
FILTER(Cliente;
RANKX(ALL(Clientes[CompanyName]); [Ventas Total];;DESC) <= 10); Productos[ProductName] = Prod)And when I select an specific year it should only show me the top 10 customers who bought the top product, in this case Okkaba Skin Jackets, but if you see in the second image only 3 customers buy it that year, therefore in the table of the first image should only be 3 customers not 10, how can I fix this?
PSD: Here's the code for "Mas Vendido" if you need it:
Mas Vendido = FIRSTNONBLANK(TOPN(1; ALL(Productos[ProductName]);[Ventas Total];DESC); 1)
HI, I try to simplify this:
Top Clientesrl = VAR Prod = [Mas Vendido] RETURN CALCULATE ( [Ventas Total]; Ordenes[ProductName] = Prod )in the visual level filter
regards
Victor
12 Replies
- v-chuncz-msftCommunity Support
- amilkarigiHelper I
In which measure? Top Clientes?
- Ashish_MathurSuper User
Hi,
My suggestion is to create a seperate RANK measure
=RANKX(ALL(Clientes[CompanyName]); [Ventas Total];;DESC)
Now in the first visual, drag this measure to the Visual Level filters and apply a criteria there of <=10.
- amilkarigiHelper I
It's does nothing :smileysad: here's a link where you can download the pbix document for better comprehension https://drive.google.com/open?id=1CHv9ejaaboVk7kS-7V0W61GPzb8uS7qs
- Ashish_MathurSuper User
Hi,
I checked another post as well where you have described the same/similar problem. Sorry but i cannot help much since the language there is no English. Also, the link that you have shared in your previous post does not work.