Forum Discussion
How to return this months Value
Hi
I think this is a simple measure but it is alluding me. I simply want to return this months value from the below data table. I will then want to also return the previous month.
| Month | Number |
| Apr-24 | £0 |
| May-24 | £0 |
| Jun-24 | £60,000 |
| Jul-24 | £1,350,000 |
| Aug-24 | £1,350,000 |
| Sep-24 | £1,430,000 |
| Oct-24 | £3,030,000 |
| Nov-24 | £7,330,000 |
| Dec-24 | £7,330,000 |
| Jan-25 | £25,730,000 |
| Feb-25 | £25,730,000 |
Any help would be appreciated
Many thanks
Massingc1983 , You can try using below measure
CurrentMonthValue =
VAR CurrentMonth = SELECTEDVALUE('Table'[Month])
RETURN
CALCULATE(SUM('Table'[Number]), 'Table'[Month] = CurrentMonth)PreviousMonthValue =
VAR CurrentMonth = SELECTEDVALUE('Table'[Month])
VAR PreviousMonth = CALCULATE(MAX('Table'[Month]), 'Table'[Month] < CurrentMonth)
RETURN
CALCULATE(SUM('Table'[Number]), 'Table'[Month] = PreviousMonth)
1 Reply
- bhanu_gautam
Super User
Massingc1983 , You can try using below measure
CurrentMonthValue =
VAR CurrentMonth = SELECTEDVALUE('Table'[Month])
RETURN
CALCULATE(SUM('Table'[Number]), 'Table'[Month] = CurrentMonth)PreviousMonthValue =
VAR CurrentMonth = SELECTEDVALUE('Table'[Month])
VAR PreviousMonth = CALCULATE(MAX('Table'[Month]), 'Table'[Month] < CurrentMonth)
RETURN
CALCULATE(SUM('Table'[Number]), 'Table'[Month] = PreviousMonth)