Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

MTD Total Column with Multiple Records per Day

$
0
0

I'm trying to get a calculated column with MTD totals but hitting a wall and need help. Data mock up for my issue:

 

excel.png

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...

pbi.png

- 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.


Viewing all articles
Browse latest Browse all 213819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>