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,
i'm facing a strange situation with a measure, so let me explain.
Here my measure :
Default year = year(max('Calendar'[Date]))
Default Month = MONTH(max('Calendar'[Date]))
Sales Default 2 = CALCULATE(sum(Sales[ Sales]);
FILTER('Calendar';'Calendar'[Year]= [Default year] && 'Calendar'[Month]=[Default Month]))so the aim is to get the last value of my Month and Year, in my table my last month is 12 and year 2017, this will give me 12 385 113€.
But !! in my measure i dont have this number, i have the sum of all my data :
Can you help me please
thanks
Solved! Go to Solution.
So you're just wanting the sum of sales for the last month on your calendar table? Why not try something like:
Sales Default 2 =
var lastdateinsample = max('Calendar'[Date])
var relatedmonth = startofmonth(lastdateinsample)
return calculate(sum(Sales[ Sales]);'Calendar'[Date]>=relatedmonth)
So you're just wanting the sum of sales for the last month on your calendar table? Why not try something like:
Sales Default 2 =
var lastdateinsample = max('Calendar'[Date])
var relatedmonth = startofmonth(lastdateinsample)
return calculate(sum(Sales[ Sales]);'Calendar'[Date]>=relatedmonth)
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 |
|---|---|
| 60 | |
| 54 | |
| 43 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 123 | |
| 106 | |
| 44 | |
| 32 | |
| 24 |