Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
hello, I use a measure that allows me to calculate an amount for the current month. Here it is below =>
For clarification: The column "Periode" is a column in date format grouping the year, month and day.
I would now like to get this same calculation for the previous month of the current year.
I tested with previous month and dateadd but it takes all my years. I can't isolate the previous month from the current year.
I need it because I want to calculate the difference between the current month and the previous month so I have to subtract the previous month measurement from the current month measurement.
Thank !
Solved! Go to Solution.
@Anonymous , Try to use date table
A= CALCULATE(SUM('ED Utilisation'[Table.Effectif Disponible]),LASTDATE('ED Utilisation'[Période]))
last month= CALCULATE([A],DATESMTD(dateadd('Date'[Date],-1,MONTH)))
or
last month = CALCULATE(lastnonvalues(LASTDATE('ED Utilisation'[Période]),SUM('ED Utilisation'[Table.Effectif Disponible]) ) ,DATESMTD(dateadd('Date'[Date],-1,MONTH)))
Hi @Anonymous
Try this which I pulled from another example that I just completed. (Running total now has the previous month date in the pic)
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
VAR _curDate =
//get the date of the current row
MAX ( TableMine[Date] )
VAR _preDate =//HERE IS THE PREVIOUS DATE,
CALCULATE (
MAX ( TableMine[Date] ),
FILTER ( ALL ( TableMine ), TableMine[Date] < _curDate )
)
VAR _calc =
//Do the running total
CALCULATE (
[Sum of Hired],
FILTER (
ALL ( TableMine ),
TableMine[Date] = _preDate))
Proud to be a Super User!
@Anonymous , Try to use date table
A= CALCULATE(SUM('ED Utilisation'[Table.Effectif Disponible]),LASTDATE('ED Utilisation'[Période]))
last month= CALCULATE([A],DATESMTD(dateadd('Date'[Date],-1,MONTH)))
or
last month = CALCULATE(lastnonvalues(LASTDATE('ED Utilisation'[Période]),SUM('ED Utilisation'[Table.Effectif Disponible]) ) ,DATESMTD(dateadd('Date'[Date],-1,MONTH)))
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 76 | |
| 52 | |
| 51 | |
| 46 |