Forum Discussion
riguberto
6 years agoFrequent Visitor
Get top n value considering duplicate values
Hello, I'm trying to set 3 different dax metrics to get the 1st,2nd,3rd values of a product price (for diferents urls). product_id url_id LastPrice product_price InvalidPrice 158946 ...
- Anonymous6 years ago
Hi riguberto ,
Is this what you are looking for.
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
riguberto
6 years agoFrequent Visitor
Thanks for your response.
rank... creating this metric pop up the error: can't determine the value of price. Maybe the column doesn't exist or it is no rows (translating myseflt from spanish... :S)
riguberto
6 years agoFrequent Visitor
ok, I didn't understood that rank was a column in the priceregistrationraw table (I was trying as a metric (I'm totally newby)).
My problem now is that the table has more products_id and they are getting ranked all together. I tried to put a product_id filter, but now the filter for lastprice and isvalid are not working (the product_id looks fine)...
What I tried
rank = rankx(FILTER(priceregistrationraw,and(NOT(priceregistrationraw[InvalidPrice]=1),AND(priceregistrationraw[LastPrice]=1,priceregistrationraw[product_id]=EARLIER(priceregistrationraw[product_id])))),[total_price_numeric],,ASC,Dense)