Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |