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.
I have a measure of Revenue for the current month. The revenue is cumulative, hence the last day revenue is my MTD calculation.
In order to be able to perform month to month comparison I would need to find the corresponding "last date" from previous month. I.e. if the lastday measure below return 11th of April, I would like the previous month measure to return 11th of March. Tried with parrarelperiod function but without any results.
All help appreciated,
thanks.
lastday = LASTDATE('sales'[dateCreated])
Revenue Current Month = CALCULATE(SUM('sales'[revenue]) , DATESBETWEEN('sales'[dateCreated].[Date],[lastday],[lastday]))
Revenue Previous Month = ?
Solved! Go to Solution.
Hi @dinovic,
According to your description above, you should be able to use Could you try the formula below to see if it works in your scenario?
Revenue Previous Month = CALCULATE ( [Revenue Current Month], DATEADD ( 'sales'[dateCreated], -1, MONTH ) )
In addition, based on my understanding, the DATEBETWEEN function is not necessary here in your [Revenue Current Month] measure, the formula below should also works.
Revenue Current Month = CALCULATE ( SUM ( 'sales'[revenue] ), 'sales'[dateCreated] = [lastday] )
Regards
Hi @dinovic,
According to your description above, you should be able to use Could you try the formula below to see if it works in your scenario?
Revenue Previous Month = CALCULATE ( [Revenue Current Month], DATEADD ( 'sales'[dateCreated], -1, MONTH ) )
In addition, based on my understanding, the DATEBETWEEN function is not necessary here in your [Revenue Current Month] measure, the formula below should also works.
Revenue Current Month = CALCULATE ( SUM ( 'sales'[revenue] ), 'sales'[dateCreated] = [lastday] )
Regards
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 |
---|---|
107 | |
98 | |
78 | |
65 | |
53 |
User | Count |
---|---|
139 | |
100 | |
95 | |
85 | |
63 |