Hi Charlton, there are a lot of different ways of going about doing this. Which option you choose will depend on what else you want in your chart, what else is being filtered, and many other factors. But having said that here's a basic formula for producing a quarter to date sales figure:
IIF(DATEPART('quarter',[Order Date])= DATEPART('quarter',TODAY()), [Sales], NULL)
This makes the assumption that your view is filtered on the current year, otherwise you'll get data from the first quarter of all years in the patrician. Like I said there are going to be many factors in choosing the best way to go about this, so if you could post a sample packaged workbook we'll be able to better help you.
Thanks a lot for the response. Shawn. It's super helpful and this works.,I was able to filter out different year with another IIF statement. I'm going to try it some more. Will come back if I run into problems.
Actually, I also have a un-related question that does tableau support any function like distinct? There are some duplicates in my data for example, for the same date and same region, the value in total month sales is the same. But of course if I try to plot that in tableau, all those duplicates will be included. is there any way to eliminate that problem?
There's COUNTD() but that isn't going to work for what you're doing. I suspect there are some contortions you could do using calculated fields (I've never tried this), but it would probably be easier to take care of the duplicates in the data source. If you want to try the calculated field route, then you should post this as another question and see if someone has tried this before. Good luck.