Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Dear all,
I would like to calculate the sum of my balance from the previous month.
So when i select january i want the sum of december.
when i select january and february, i want to to sum december.
when i select february and march, i want the sum of january. and so on.
something like: calculate (sum(table1[value]);min(date)-1month)
Hi,
Create a Calendar Table with a Date column and build a relationship from the Date column of Table1 to the Date column of the Calendar Table. In the Calendar Table, write these calculated column formulas to extract the Year and Month
Year = Year(Calendar[Date])
Month = FORMAT(Calendar[Date],"mmmm")
Build slicers for Year and Month and select any one Year in the Year slicer. Select one/multiple months in the Month slicer. Write this measure
=CALCULATE(SUM(Table1[Value]),DATESBETWEEN(Calendar[Date],EDATE(MIN(Calendar[Date]),-1),MIN(Calendar[Date])-1))
Hope this helps.
Please try one of the following
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date Filer],-1,MONTH))) perious month = Var _end_date= minx(ALLSELECTED('Date'),ENDOFMONTH(dateadd('Date'[Date Filer],-1,MONTH))) Var _start_date =minx(ALLSELECTED('Date'),STARTOFMONTH(dateadd('Date'[Date Filer],-1,MONTH))) Var _last_mtd_val= CALCULATE(sum(Sales[Sales Amount]),Sales[Sales Date] >= _start_date && (Sales[Sales Date]) <= _end_date) return _last_mtd_val
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
97 | |
81 | |
77 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |