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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Georgez96
Frequent Visitor

Trying To Implement Previous Month Totals But It Only Works For One Month

I'm trying to compare current month total expenses to the previous month total expenses. I'm using this to calculate that:

previous month total expense = CALCULATE( SUM(Expenses[Amount]),MONTH(Expenses[Date of Transaction])=MONTH(TODAY())-1 , YEAR(Expenses[Date of Transaction])=YEAR(TODAY())) 
 
This only works when I use the slicer on the right when its sliced by last 1 month from the current date but not a calendar month. Additionally, it also does not work when I use the Month slicer on the left. Note that the Month slicer is from a different calendar table that is already joined to dates from the slicer on the right. I want to use the month slicer so that I can view the previous month totals, not last month from the current date. Screenshots are down below, would appreciate the help. 
Screen Shot 2022-10-05 at 5.16.51 PM.pngScreen Shot 2022-10-05 at 5.16.00 PM.png
1 ACCEPTED SOLUTION
v-yadongf-msft
Community Support
Community Support

Hi @Georgez96 ,

 

Please check the relationship between two tables.

 

This is my test table:

vyadongfmsft_0-1665024727982.png

 

Create a new calendar table:

Table = ADDCOLUMNS(CALENDAR(DATE(2022,7,1),DATE(2022,9,30)),"Month",FORMAT([Date],"mmm"))

 

Relationship between two tables:

vyadongfmsft_1-1665024826803.png

 

You can use the month slicer to view the previous month totals:

vyadongfmsft_2-1665024859935.png

Best regards,

Yadong Fang

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

4 REPLIES 4
v-yadongf-msft
Community Support
Community Support

Hi @Georgez96 ,

 

Please check the relationship between two tables.

 

This is my test table:

vyadongfmsft_0-1665024727982.png

 

Create a new calendar table:

Table = ADDCOLUMNS(CALENDAR(DATE(2022,7,1),DATE(2022,9,30)),"Month",FORMAT([Date],"mmm"))

 

Relationship between two tables:

vyadongfmsft_1-1665024826803.png

 

You can use the month slicer to view the previous month totals:

vyadongfmsft_2-1665024859935.png

Best regards,

Yadong Fang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Furthermore, it seems to work only when I use the slicer from last month to current date(ex: 9/08/2022 - 10/08/2022) but not a calendar month. 

Screen Shot 2022-10-08 at 2.08.17 PM.png

Hi @Georgez96 ,

 

Can you share with me some screenshots of your data and relationships after hiding sensitive information?

Thanks for your efforts & time in advance.

 

Best regards,

Yadong Fang

I have a relationship already established between those two columns but perhaps  it has to do with the cardinality?

Screen Shot 2022-10-08 at 12.26.03 PM.png

Screen Shot 2022-10-08 at 12.21.25 PM.png

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.