Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi team,
I have inherited a report with a cumulative measure that starts on 1st of current month. I need to make another one that looks at cumulative previous month and calculate different between them on specific days. The issue is that I don't fully understand how the current measure works and don't really know how to adjust it. Any help would be much appreciated.
_timeIntelMonthSALES =
VAR CurrentDay = TODAY()
VAR MaxDate = MAX('Transaction Date'[*Date (trans)])
VAR CurrentMonth = MONTH(CurrentDay)
VAR CurrentYear = YEAR(CurrentDay)
VAR FirstDay = DATE(CurrentYear, CurrentMonth, 1)
VAR SO = IF(TODAY() = DATESBETWEEN('Transaction Date'[*Date (trans)], FirstDay, CurrentDay), [_Revenue £], 0)
VAR Res = SUMX(
FILTER(
ALL('Transaction Date'),
'Transaction Date'[*Date (trans)] >= DATE(CurrentYear, CurrentMonth, 1)
&& 'Transaction Date'[*Date (trans)] <= MaxDate
&& 'Transaction Date'[*Date (trans)] <= CurrentDay
),
[_Revenue £]
)
RETURN
IF(FORMAT(MaxDate, "YYYYMM" ) = FORMAT(CurrentDay, "YYYYMM"), Res, BLANK())
@Matej , Usually with help from date table we can use method like these for cumulative or running total
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=max('Date'[date])))
Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=max(date[Date])))
Cumm Based on Date = CALCULATE([Net], Window(1,ABS,0,REL, ALL('date'[date]),ORDERBY('Date'[date],ASC)))
Cumm Based on Date = CALCULATE([Net], Window(1,ABS,0,REL, ALLSELECTED('date'[date]),ORDERBY('Date'[date],ASC)))
For last month
Cumm Sales till last month= CALCULATE(SUM(Sales[Sales Amount]),filter(all('Date'),'Date'[date] <=maxX('Date', dateadd('Date'[date],-1, month) )))
Cumm Sales till last month = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),'Date'[date] <=maxX('Date', dateadd('Date'[date],-1, month) )))
User | Count |
---|---|
81 | |
76 | |
69 | |
69 | |
54 |
User | Count |
---|---|
104 | |
99 | |
92 | |
78 | |
69 |