Forum Discussion
TREATAS
HI All,
Need to find previousmonth sales using TREATAS
below is the sample code......
Hi, vijay273162
TREATAS is used to apply the result of a table expression as filters to columns from an unrelated table.
You should make sure that here should be no physical relationship between Table "Orders" and Table "Delivery Dates Table".
Best Regards,
Community Support Team _ Eason
3 Replies
- amitchandakSuper User
vijay273162 , You should use date table, Try like
CALCULATE(SUM(Order[sales]),
TREATAS (PREVIOUSMONTH( 'Order-datetable'[date] ),
'Order-datetable'[date] )
)or
CALCULATE(SUM(Order[sales]),
TREATAS (PREVIOUSMONTH( 'Date'[date] ),
'Order-datetable'[date] )
)- vijay273162Helper III
If I use PREVIOUSMONTH in TREATAS, then..... I don't get any result in my table matrxi below.
So, I need to move the filter from delivery date table to order date table - at the sametime find the previousmonth data.
- v-easonf-msftCommunity Support
Hi, vijay273162
TREATAS is used to apply the result of a table expression as filters to columns from an unrelated table.
You should make sure that here should be no physical relationship between Table "Orders" and Table "Delivery Dates Table".
Best Regards,
Community Support Team _ Eason