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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have monthly data for sales in format like
I want to calculate current month sales for each channel and previous month sales for each channel. I create a matrix with channel in rows and current month values in columns:
but strangely I can not reference the date column inside my measure:
CurrentMonthSales = CALCULATE(SUM('SalesTable'[Sales]),
FILTER('SalesTable', YEAR('SalesTable'[Date]) = YEAR(TODAY())),
FILTER ('SalesTable', MONTH('SalesTable'[Date] = MONTH(TODAY()))
))
Solved! Go to Solution.
Hey @darkmetrics ,
I do not understand what you mean by: "... I can not reference the date column inside my measure."
Nevertheless, I would write the measure like so:
CurrentMonthSales =
var __TODAY = TODAY()
var currentYear = YEAR( __TODAY )
var currentMonth = MONTH( __TODAY )
return
SUMX(
FILTER( 'SalesTable'
, YEAR('SalesTable'[Date]) = currentYear && MONTH('SalesTable'[Date] = currentMonth
)
, 'SalesTable'[Sales]
)
Hopefully, this helps what you are looking for.
Regards,
Tom
Hey @darkmetrics ,
I do not understand what you mean by: "... I can not reference the date column inside my measure."
Nevertheless, I would write the measure like so:
CurrentMonthSales =
var __TODAY = TODAY()
var currentYear = YEAR( __TODAY )
var currentMonth = MONTH( __TODAY )
return
SUMX(
FILTER( 'SalesTable'
, YEAR('SalesTable'[Date]) = currentYear && MONTH('SalesTable'[Date] = currentMonth
)
, 'SalesTable'[Sales]
)
Hopefully, this helps what you are looking for.
Regards,
Tom
Thank you, I will try
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 62 | |
| 51 | |
| 45 |