Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi,
I am trying to create a measure that calculates the three months run rate by taking into consideration the same dates in the current month.
In other words, I want to sum the data from the first till the 26th of each of the previous months.
How?
I tried the below code but the measure is considering full month. Please advise.
3M RR = CALCULATE ( [Sales], DATESINPERIOD ( 'Date'[Date], LASTDATE ( PREVIOUSMONTH ('Date'[Date]) ), -3, MONTH ) )/3
Solved! Go to Solution.
Thanks @Ashish_Mathur for your help.
I found an easier way of doing it:
3M RR = CALCULATE(sum([sales]), DATESINPERIOD('Date'[Date],LASTDATE(PREVIOUSMONTH('Date'[Date])),-3,MONTH),Day(['Date'[Date]<=DAY(TODAY()-2))/3
Need sample data. 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
That being said, my Time Intelligence The Hard Way Quick Measure might help:
Thanks for the reply.
PFA sample PBI file along with data.
Basically, there are 3 countries that have data between 1st of April until the 30th of August.
The goal is to create a measure the will sum the sales of the below dates and then divide by 3 (3M RR)
Basically, I am considering the 1st date of each month of the previous 3 months and end the month on same day number of today.
Sample Data: https://1drv.ms/x/s!Akro-bcp8uVLg2xEIUEsf3vO2KCl
Sample PBI: https://1drv.ms/u/s!Akro-bcp8uVLg20CGN9A_YqWu1ee
Hi,
You may download my PBI file from here.
Hope this helps.
Thanks @Ashish_Mathur for your help.
I found an easier way of doing it:
3M RR = CALCULATE(sum([sales]), DATESINPERIOD('Date'[Date],LASTDATE(PREVIOUSMONTH('Date'[Date])),-3,MONTH),Day(['Date'[Date]<=DAY(TODAY()-2))/3
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
112 | |
105 | |
94 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |