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 )
tamerj1
Community Champion
4 years agoHi 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" )Anonymous
4 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"?
- tamerj14 years ago
Community Champion
Anonymous
Can you please create a columnCOUNTROWS ( RELATEDTABLE ( 'Order Line Items' ) )and let me know what results you get
- Anonymous4 years agoNot applicable
- tamerj14 years ago
Community Champion
Great Anonymous
Please use
Calculated Brand Column = IF ( COUNTROWS ( RELATEDTABLE ( 'Order Line Items' ) ) = 1, CALCULATE ( VALUES ( 'Order Line Items'[Brand] ) ), "Mixed Order" )