I'm trying to get a calculated column with MTD totals but hitting a wall and need help. Data mock up for my issue:
However, my code is duplicating the total for the day on each line:
MTDSales = VAR RowDate = SalesData[Date] RETURN CALCULATE ( SUM (SalesData[Sales]), FILTER ( SalesData, SalesData[Date] <= rowdate&& SalesData[Agent] = earlier(SalesData[Agent]) ) )
Results in...
- My actual dataset does span multiple months, so will need logic to take into account the month
- I'm using a calculated column because I will need use these totals for a separate measure (i.e. track how far an agent is above goal day once he hits goal)
New to PBI, any help is appreciated.