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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 60 | |
| 53 | |
| 40 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 97 | |
| 81 | |
| 35 | |
| 29 | |
| 25 |