The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Solved! Go to Solution.
@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)
Proud to be a 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)
Proud to be a Super User! |
|
User | Count |
---|---|
20 | |
8 | |
7 | |
7 | |
6 |
User | Count |
---|---|
28 | |
12 | |
11 | |
9 | |
8 |