Forum Discussion
Bottom N DAX help
Using below DAX we are getting Top 1 Item
Measure 1 =
var top1Brand = CALCULATE(TOPN(1,ALLSELECTED(Item[Item]),[Summary],DESC))
return
top1Item
To get the Bottom 1 Item , we using below but we are getting below error. Please kindly help, it is very urgent
Measure 2 =
var Bottom1Item = CALCULATE(TOPN(1,ALLSELECTED(Item[Item]),[Summary],ASC))
return
Bottom1Item
Error:
A table of multiple values was supplied where a single value was expected.
2 Replies
- amitchandakSuper User
pbiforum123 , You need to try TOPN like, assuming Summary is a measure
calculate([Summary], TOPN(2, allselected('Item'Item]), [Summary],desc), values('Item'[Item]))
- pbiforum123Post Patron
amitchandak Thanks!
Yes Summary is a measure but this is not getting me expected result. The dax which I have shared gives me item name which has top sales value what I need is I want a DAX which can return the item which has least sales. Hope you got my requirement. Please let me know if you have any questions.