Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hi, @Anonymous ;
Hi, @Anonymous ;
After my test, I don't understand the reason why your first day is blank. In my case, I worked on the first day of the beginning of the month.
So can you share some screenshots and scenes about your mistake?
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Try using time intelligece or force it
MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
///forced
MTD QTY forced=
var _max = maxx(allselected(Date), Date[Date])
return
if(max('Date'[Date])<=_max, calculate(Sum('order'[Qty]),DATESMTD('Date'[Date])), blank())
//or
//calculate(Sum('order'[Qty]),DATESMTD('Date'[Date]),filter('Date','Date'[Date]<=_max))
//calculate(TOTALMTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))
LMTD QTY forced=
var _max1 = maxx(allselected(Date), Date[Date])
var _max = date(year(_max1), Month(_max1)-1, day(_max1))
return
if(max('Date'[Date])<=_max, calculate(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date]),-1,month)), blank())
//or
I tried using this dax but it is not working it is showing sales for overall month instead of sales of no of days in previous month as current month
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.