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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have scenario where I have to filter sales for last 3 months based on current Month.
Ex: If Selected Month is March which has maximum date 11th (11-Mar-2021) . I'll need to calculate for Last 3 months excluding current Month i.e. neet to get the vaule of Feb 2021 ,Jan 2021,Dec 2020.
current formula :
Solved! Go to Solution.
Hi @Easley06
Please try
P3 =
VAR CurrentDate =
MAX ( DATE_SYSTEM[DATE] )
VAR EndDate =
EOMONTH ( CurrentDate, - 1 )
VAR StartDate =
EOMONTH ( CurrentDate, - 5 ) + 1
RETURN
CALCULATE (
SUM ( FACT_OFF_TAKE[GROSS_AMT] ),
DATE_SYSTEM[DATE] >= StartDate,
DATE_SYSTEM[DATE] <= EndDate,
ALL ( DATE_SYSTEM[MONTH_NAME], DATE_SYSTEM[MONTH], DATE_SYSTEM[YEAR] )
) / 3
Hi @Easley06
Please try
P3 =
VAR CurrentDate =
MAX ( DATE_SYSTEM[DATE] )
VAR EndDate =
EOMONTH ( CurrentDate, - 1 )
VAR StartDate =
EOMONTH ( CurrentDate, - 5 ) + 1
RETURN
CALCULATE (
SUM ( FACT_OFF_TAKE[GROSS_AMT] ),
DATE_SYSTEM[DATE] >= StartDate,
DATE_SYSTEM[DATE] <= EndDate,
ALL ( DATE_SYSTEM[MONTH_NAME], DATE_SYSTEM[MONTH], DATE_SYSTEM[YEAR] )
) / 3
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 18 | |
| 12 | |
| 11 |