Forum Discussion
alexa_0028
Resolver II
4 years agoCreate table with cross join filtering
Hi All, I have a DASX like below for calculating table : Calculated Table = DISTINCT(SELECTCOLUMNS( CROSSJOIN('Product','Mapping'), "Product Code",'Product'[P. Code], "Product Description",...
- 4 years ago
alexa_0028 does this improve
Calculated Table = DISTINCT ( SELECTCOLUMNS ( ADDCOLUMNS ( 'Product', "L6", VAR _lookup = 'Product'[P. Code] VAR _looupValue = CALCULATE ( MAX ( 'Mapping'[L2] ), TREATAS ( { _lookup }, 'Mapping'[P. Code] ) ) RETURN IF ( _looupValue = BLANK (), "not mapped", _looupValue ) ), "Product Code", [P. Code], "Product Description", [Product], "L6", [L6] ) ) - 4 years ago
alexa_0028 is this any better
Calculated Table = ADDCOLUMNS ( SUMMARIZE ( 'Product', "Product Code", [P. Code], "Product Code", [P. Code] ), "L6", VAR _lookup = 'Product'[P. Code] VAR _looupValue = CALCULATE ( MAX ( 'Mapping'[L2] ), TREATAS ( { _lookup }, 'Mapping'[P. Code] ) ) RETURN IF ( _looupValue = BLANK (), "not mapped", _looupValue ) ) - 4 years ago
Your SUMMARIZE looks strange to me. Did you mean to write this?
Calculated Table = SELECTCOLUMNS ( SUMMARIZE ( 'Product', 'Product'[P. Code], 'Product'[Product] ), "Product Code", 'Product'[P. Code], "Product Description", 'Product'[Product], "L6", VAR _lookup = [...] )
smpa01
Community Champion
4 years agoalexa_0028 does this improve
Calculated Table =
DISTINCT (
SELECTCOLUMNS (
ADDCOLUMNS (
'Product',
"L6",
VAR _lookup = 'Product'[P. Code]
VAR _looupValue =
CALCULATE ( MAX ( 'Mapping'[L2] ), TREATAS ( { _lookup }, 'Mapping'[P. Code] ) )
RETURN
IF ( _looupValue = BLANK (), "not mapped", _looupValue )
),
"Product Code", [P. Code],
"Product Description", [Product],
"L6", [L6]
)
)
- alexa_00284 years ago
Resolver II
Hi smpa01
All the solutions worked well, thank you so much for your help.
This was very useful indeed. Huge Kudos to you.