Forum Discussion
Rosh89
Helper I
3 years agoDAX for calculating previous month values
Hi, I have a table as shown below: Month Period Customer Bonus Previous bonus Jan-22 1 A 100 Feb-22 2 A 200 100 Mar-22 3 A 150 200 Jan-22 1 B 300 Feb-22...
- Anonymous3 years ago
Hi Rosh89 ,
You could add a date column like below:
date = DATEVALUE("1-"&'Table'[Month])Then create a measure:
Measure = CALCULATE(SUM('Table'[Bonus]),FILTER(ALLEXCEPT('Table','Table'[Customer]),'Table'[date]=EDATE(SELECTEDVALUE('Table'[date]),-1)))
Shaurya
Memorable Member
3 years agoHi Rosh89,
You can use:
Previous Bonus = SUMX('Table',IF('Table'[Month].[MonthNo]=EARLIER('Table'[Month].[MonthNo])-1 && 'Table'[Customer]=EARLIER('Table'[Customer]),'Table'[Bonus],0))
Works for you? Mark this post as a solution if it does!
Check out this blog of mine: How to Export Telemetry Data from Azure IoT Central into Power BI