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
Hi,
This is probably a really simple question but I'm new to DAX and even after trying to use AI to produce the code for me, it's still not working.
Essentially, I want to be able to use the calculate function and make it only return data for the current month. At the minute, i've got a calender lookup table with a 'Start of month' column and i've duplicated that column and turned it into text, so I can use this:
Solved! Go to Solution.
GIve this a try, not sure if I named the actual start of month column in your date table correctly.
Revenue add MTD =
VAR _StartOfMonth =
EOMONTH ( TODAY (), -1 ) + 1 //find the end of last month then add a day to get the start of this month
RETURN
CALCULATE ( [Pipeline], 'Calendar-Lookup'[Start of Month] = _StartOfMonth )
Try with this measure
RevenueAddMTD =
CALCULATE([Pipeline],
FILTER('Calendar-Lookup',
MONTH('Calendar-Lookup'[Start of Month]) = MONTH(TODAY()) &&
YEAR('Calendar-Lookup'[Start of Month]) = YEAR(TODAY()))
)
Hope this helps you!
You want to avoid using FILTER over an entire table. The performance hit can be substantial.
https://www.sqlbi.com/articles/filter-columns-not-tables-in-dax/
GIve this a try, not sure if I named the actual start of month column in your date table correctly.
Revenue add MTD =
VAR _StartOfMonth =
EOMONTH ( TODAY (), -1 ) + 1 //find the end of last month then add a day to get the start of this month
RETURN
CALCULATE ( [Pipeline], 'Calendar-Lookup'[Start of Month] = _StartOfMonth )
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |