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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
KH11NDR
Helper IV
Helper IV

Calculate current month with a different row previous month

Hi Guys,

 

How do i write a measure or calculated column to do this?  Thanks in advance.

 

 Jan Feb Mar Apr 
Total100150300699 
Revenue4090150549 I want the bold cell to calculate Current months Total - Last months revenue
      
1 ACCEPTED SOLUTION

Hi @KH11NDR,

 

I have made a test with your logic. 

 

I created a two calculated columns below and get the output.

 

last month revenue = CALCULATE(SUM('Table'[Previous Revenue Submitted (£)]),PREVIOUSMONTH('Master Calendar'[Date]))

Column = 'Table'[Commercial  Total]-[last month revenue]

 

Untitled.png

 

If you still need help, please share a dummy pbix file which can reproduce the scenario, so that we can help further investigate on it? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.)

 

Best Regards

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
KH11NDR
Helper IV
Helper IV

ProjectIDProjectDatePrevious Revenue Submitted (£)Commercial  Total
1aaa01/07/20180.001457068
2bbbb01/06/20173339.981457068

 

Date linked to a Date master calendar table, 

 

Master Calendar = ADDCOLUMNS ( CALENDAR (DATE(2017,01,01), DATE(2018,12,31)), "DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ), "Year", YEAR ( [Date] ), "MonthNo", FORMAT ( [Date], "MM" ), "YearMonthNo", FORMAT ( [Date], "YYYY/MM" ), "YearMonth", FORMAT ( [Date], "YYYY/mmm" ), "MonthShort", FORMAT ( [Date], "mmm" ), "MonthLong", FORMAT ( [Date], "mmmm" ), "WeekNo", WEEKNUM([Date]), "WeekDay", FORMAT ( [Date], "dddd" ), "WeekDayShort", FORMAT ( [Date], "dddd" ), "Quarter", "Q" & FORMAT ( [Date], "Q" ), "YearQuarter", FORMAT ( [Date], "YYYY" ) & "/Q" & FORMAT ( [Date], "Q" ), "Month Year", FORMAT ( [Date], "mmm") & " - " & FORMAT( [Date], "yy"))

 

I need this months commercial total - last months  Previous Revenue Submitted (£)

v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @KH11NDR,

 

I'm not very clear about your logic, could you describe your requirement in more details.

 

I would appreciate it if you could share your expected output.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
Community Champion

What does your raw data look like? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

ProjectIDProjectDatePrevious Revenue Submitted (£)Commercial  Total
1aaa01/07/20180.001457068
2bbbb01/06/20173339.981457068

 

Date linked to a Date master calendar table, 

 

Master Calendar = ADDCOLUMNS ( CALENDAR (DATE(2017,01,01), DATE(2018,12,31)), "DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ), "Year", YEAR ( [Date] ), "MonthNo", FORMAT ( [Date], "MM" ), "YearMonthNo", FORMAT ( [Date], "YYYY/MM" ), "YearMonth", FORMAT ( [Date], "YYYY/mmm" ), "MonthShort", FORMAT ( [Date], "mmm" ), "MonthLong", FORMAT ( [Date], "mmmm" ), "WeekNo", WEEKNUM([Date]), "WeekDay", FORMAT ( [Date], "dddd" ), "WeekDayShort", FORMAT ( [Date], "dddd" ), "Quarter", "Q" & FORMAT ( [Date], "Q" ), "YearQuarter", FORMAT ( [Date], "YYYY" ) & "/Q" & FORMAT ( [Date], "Q" ), "Month Year", FORMAT ( [Date], "mmm") & " - " & FORMAT( [Date], "yy"))

 

I need this months commercial total - last months  Previous Revenue Submitted (£)

I've tried PREVIOUSMONTH, still don't work.

 

PM **bleep** Revenue Submitted = CALCULATE([Sum of Cumulative Revenue Submitted],PREVIOUSMONTH('Calc Numbers'[Date]))

Hi @KH11NDR,

 

I have made a test with your logic. 

 

I created a two calculated columns below and get the output.

 

last month revenue = CALCULATE(SUM('Table'[Previous Revenue Submitted (£)]),PREVIOUSMONTH('Master Calendar'[Date]))

Column = 'Table'[Commercial  Total]-[last month revenue]

 

Untitled.png

 

If you still need help, please share a dummy pbix file which can reproduce the scenario, so that we can help further investigate on it? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.)

 

Best Regards

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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