Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register 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)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 33 | |
| 31 | |
| 29 |