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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Tamanna
New Member

Compare data with previous period and current month

Hi Team,

I am very new to Power BI and want to create report by comparing the data of previous months with the current month. But this report is refreshed every month so I want Power BI to identify what is current month and previous months.

 

So for example :

A of now

previous month : 01/2018

current month : /2018,

however next month

 

Previous Months: 01/2018 + 02/2018

Current month : 03/2018

 

and so on.

 

Based on this I want the count of assets appearing in previous months but missing in current month and vseversa. Is it possible?

1 REPLY 1
mmace1
Impactful Individual
Impactful Individual

So this is the way I figured out awhile ago; I'd be curious if there's a smarter way: 

 

This will give the first of last month: 

date(year(today()),month(today())-1,1) 

So right now it would evaluate to January 1st 2018

 

Your row of data must have a column with the date (your Datefield); this would transform that date to the first of the month. 

date(year(YourDateField),month(YourDateField),1)

So if your DateField were September 27 2017, this would evaluate to September 1st 2017. 

 

Then you could set them equal to each other.  As such, TRUE would mean the date was last month, and FALSE would mean it's not. 

date(year(today()),month(today())-1,1) = date(year(YourDateField),month(YourDateField),1) 

 

If you remove the '-1' in the first part, you'd instead be returning if your row was from the current month, '-2' would make it 2 months ago, etc. 

 

Then in your report or measures, you just filter by the TRUE/FALSE column(s) you've created. 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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