Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The 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.

Reply
Massingc1983
Frequent Visitor

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. 

 

MonthNumber
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

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
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)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
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)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.