Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi Team,
I have been working on a report where I want to display the cumulative total of last 3 months along with the previous months added values
Solved! Go to Solution.
@pradeepnani Try using
VAR LastSDate = MAX('CALENDAR'[Date])
VAR Last3Months = DATESINPERIOD('CALENDAR'[Date], LastSDate, -3, MONTH)
VAR Last3MonthsSum = CALCULATE(SUM(Orders[Freight]), Last3Months)
VAR Month1 = CALCULATE(SUM(Orders[Freight]), DATESINPERIOD('CALENDAR'[Date], LastSDate, -1, MONTH))
VAR Month2 = CALCULATE(SUM(Orders[Freight]), DATESINPERIOD('CALENDAR'[Date], EDATE(LastSDate, -1), -1, MONTH))
VAR Month3 = CALCULATE(SUM(Orders[Freight]), DATESINPERIOD('CALENDAR'[Date], EDATE(LastSDate, -2), -1, MONTH))
RETURN IF(
ISBLANK(SELECTEDVALUE('CALENDAR'[MONTH_YEAR])),
0,
FORMAT(Last3MonthsSum, "#,##0") & " (" & FORMAT(Month1, "#,##0") & ") + (" & FORMAT(Month2, "#,##0") & ") + (" & FORMAT(Month3, "#,##0") & ")"
)
Proud to be a Super User! |
|
@pradeepnani Try using
VAR LastSDate = MAX('CALENDAR'[Date])
VAR Last3Months = DATESINPERIOD('CALENDAR'[Date], LastSDate, -3, MONTH)
VAR Last3MonthsSum = CALCULATE(SUM(Orders[Freight]), Last3Months)
VAR Month1 = CALCULATE(SUM(Orders[Freight]), DATESINPERIOD('CALENDAR'[Date], LastSDate, -1, MONTH))
VAR Month2 = CALCULATE(SUM(Orders[Freight]), DATESINPERIOD('CALENDAR'[Date], EDATE(LastSDate, -1), -1, MONTH))
VAR Month3 = CALCULATE(SUM(Orders[Freight]), DATESINPERIOD('CALENDAR'[Date], EDATE(LastSDate, -2), -1, MONTH))
RETURN IF(
ISBLANK(SELECTEDVALUE('CALENDAR'[MONTH_YEAR])),
0,
FORMAT(Last3MonthsSum, "#,##0") & " (" & FORMAT(Month1, "#,##0") & ") + (" & FORMAT(Month2, "#,##0") & ") + (" & FORMAT(Month3, "#,##0") & ")"
)
Proud to be a Super User! |
|
@pradeepnani ,It would be better if instead of snap you share code with which we can work.
Proud to be a Super User! |
|
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
12 | |
9 | |
9 | |
9 |
User | Count |
---|---|
19 | |
14 | |
14 | |
13 | |
12 |