Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
HI All,
Need to find previousmonth sales using TREATAS
below is the sample code......
Solved! Go to Solution.
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
@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] )
)
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.
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
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 53 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 123 | |
| 108 | |
| 44 | |
| 32 | |
| 26 |