This formula is hit/miss returning correct value sometimes. In the picture you can see it is returning correctly 50% of the time....
此公式有时命中/未命中返回正确值。在图片中,您可以看到50%的时间是正确返回的……
t.LatestUnit$ =
VAR _LatestItem =
MAX ( 'Test'[Cat#-UOM] )
RETURN
MAXX (
FILTER ( ALL ( 'Test' ), 'Test'[Cat#-UOM] = _LatestItem ),
'Test'[UNIT $]
)
更多回答
优秀答案推荐
You should try something like this:
你应该试着这样做:
LatestPricePerItem =
VAR vMaxOrderDate = MAX ( 'Table'[OrderDate] )
RETURN
CALCULATE (
MAX ( 'Table'[UNIT $] ),
FILTER ( 'Table', 'Table'[OrderDate] = vMaxOrderDate )
)
Instead of getting the max item, you need to get the max date for each item and because you are using a table visual, there is no problem with some type of context.
您需要获取每个条目的最大日期,而不是获取最大条目,并且因为您使用的是表格视觉,所以某些类型的上下文不存在问题。
更多回答
That worked!! Thanks for your assistance!
成功了!!感谢您的帮助!
我是一名优秀的程序员,十分优秀!