Forum Discussion
GJUDGE
Helper II
4 years agoComparing Periods in the same table
I am sure this is a fairly straightforward problem for most but I'm fairly new to Power BI and any help is appreciated! I have a single table that compiles monthly reporting information. I want t...
- 4 years ago
Hi GJUDGE
You can use Edate() function to get last period, for example,
Last Period = var _currentDate=MAX('table'[date]) var _lastDate=EDATE(_currentDate,-1) return CALCULATE(SUM('table'[Output]),'table'[date]=_lastDate)Kindly note: Edate() function has some limitations,
If you can't use Edate() on some occasions, you can try this measure,
Last Period = var _maxDate=MAX('table'[date]) var _lastDate=DATE(YEAR(_maxDate),MONTH(_maxDate)-1,1) return CALCULATE(SUM('table'[Output]),'table'[date]=_lastDate)Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
vanessafvg
Community Champion
4 years agoso you saying you want to sum this months and sum last month and then work out the difference as a change %?
- GJUDGE4 years ago
Helper II
Not even a % change, just the difference, but my main worry is not needing to update the measure each month every time a new months worth of data is added. Any tips are welcomed!