Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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?
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.
User | Count |
---|---|
84 | |
76 | |
74 | |
48 | |
39 |
User | Count |
---|---|
114 | |
56 | |
51 | |
42 | |
42 |