Forum Discussion
Anonymous
4 years agoNot applicable
How to compare two Rows value in same table and assign a value in a separate column based on it
Hi Team, I need help in below logic: I have three tables: Orders table (Contains 1 row per orders placed with customer and revenue data as whole) Order line items table (Contains brief Orde...
- 4 years ago
Anonymous
Please useColumn = VAR Brand = CALCULATE ( SELECTEDVALUE ( 'Order Line Items'[Brand] ) ) RETURN IF ( ISBLANK ( Brand ), "Mixed Order", Brand )
Anonymous
4 years agoNot applicable
Hi tamerj1
I tried the solution provided by you, but in my case it is not returning the expected value. When I am applying the DAX provide by you above, it is returning the values as in the screenshot below:
We need a little modification in the logic.
tamerj1
4 years agoCommunity Champion
Hi Anonymous
Please try
Calculated Brand Column =
VAR Check =
SUMX (
RELATEDTABLE ( 'Order Line Items' ),
IF ( HASONEVALUE ( 'Order Line Items'[Brand] ), 1 )
)
RETURN
IF ( Check >= 1, VALUES ( 'Order Line Items'[Brand] ), "Mixed Order" )- Anonymous4 years agoNot applicable
Hi tamerj1 ,
It is still only giving all values as "Mixed Order". Please see the screenshot below:
Can we compare orders column with Brand column, like if One Order is having multiple brand purchased together it returns "Mixed Order" else "Brand"?