0
votes

I have a view that shows total emails sent per jobid.

E.g.

Select count(*)
...
Group by jobid

So results will be like...

Jobid 123 count 46533

In power bi I want to show a total of that count for the last week but e erg measure I try gives me bad figures...

Hoping someone can advise

Job Id Total emails sent 161345 5000 161435 7000

In power bi I want to display this as 12000 emails sent

1
Please show us some sample data: the data, expected value, actual value, etc.The Lyrist
Edited question with exampleMatthew Stott
@MatthewStott To be able to do this you should have some date column for when the email has been sent.Stivan
Sorry yes, the jobid field is linked to a job table in power bi that holds the email sent dateMatthew Stott

1 Answers

0
votes

You'll need to remove jobid from the group by and use a date on the view instead.

SELECT COUNT('8')
FROM ... 
WHERE [email_send_date] > DATEADD(week,-1,GETDATE())

I hardcoded the value for 7 days ago. There are more elegant ways to do this, but I would like to see what date format we are using on the view.

Can you provide sample data?