Forum Discussion
Anonymous
4 years agoNot applicable
Required DAX Formula
Dear Sir, My query is to defined retailer class ( updated Retailer Class in trail mail) basis on the latest month of retailer transaction in power BI. Please help to resolve this issue. ...
- Anonymous4 years ago
Hi Anonymous ,
Please try this code to create a calculated column.
Updated Retailer Class Remarks = VAR _LAST_MONTH = CALCULATE ( MAX ( 'Table'[Month] ), ALLEXCEPT ( 'Table', 'Table'[Retailer UID] ) ) RETURN CALCULATE ( MAX ( 'Table'[Retailer Class] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[Retailer UID] ), 'Table'[Month] = _LAST_MONTH ) )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
4 years agoNot applicable
Hi Anonymous ,
Please try this code to create a calculated column.
Updated Retailer Class Remarks =
VAR _LAST_MONTH =
CALCULATE (
MAX ( 'Table'[Month] ),
ALLEXCEPT ( 'Table', 'Table'[Retailer UID] )
)
RETURN
CALCULATE (
MAX ( 'Table'[Retailer Class] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[Retailer UID] ),
'Table'[Month] = _LAST_MONTH
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
hi,
when we use this in power pivot data modle it's showing error
how can we use in power pivot data model
Error is :
The function MAX takes an argument that evaluates to numbers or dates and cannot work with values of type String.