Forum Discussion
JIRAMON
3 years agoFrequent Visitor
Create new table with: ADDCOLUMN, SELECTCOLUMN, FILTER
Hi all, I have been trying without success to create a new table that 1st adds 2 columns from 2 related tables, then selects some of the columns from the resulting table, and then Filters. I expl...
- 3 years ago
Leverage physic relationships for better performance,
Latest = ADDCOLUMNS( CALCULATETABLE( 'Invoice Lines', FILTER( Invoices, Invoices[Invoice Date] = CALCULATE( MAX( Invoices[Invoice Date] ), ALLEXCEPT( Invoices, Invoices[Customer ID] ) ) ) ), "Cust ID", RELATED( Invoices[Customer ID] ), "Inv Date", RELATED( Invoices[Invoice Date] ), "Item Name", RELATED( Items[Item Name] ) )
ThxAlot
Super User
3 years ago
Leverage physic relationships for better performance,
Latest =
ADDCOLUMNS(
CALCULATETABLE(
'Invoice Lines',
FILTER(
Invoices,
Invoices[Invoice Date]
= CALCULATE(
MAX( Invoices[Invoice Date] ),
ALLEXCEPT( Invoices, Invoices[Customer ID] )
)
)
),
"Cust ID", RELATED( Invoices[Customer ID] ),
"Inv Date", RELATED( Invoices[Invoice Date] ),
"Item Name", RELATED( Items[Item Name] )
)