Create a calculated field with this formula:
IF YEAR([Your Date Dimension])=YEAR(NOW()) AND MONTH([Your Date Dimension])=MONTH(NOW())-1 THEN [Your Measure] END
I hope this helps
Unlike Excel, which is a cell-based software, Tableau does not 'fetch' values from other worksheets cells. That's not to say you can't do what you're wanting to do, it's just that you need to do it all in one sheet. Meaning each time you want to use SUM(Sales) you just drag sales out onto the current sheet, not go look it up on another sheet.
You're probably looking for something like this using Superstore:
IF DATETRUNC('month', [Order Date]) = DATETRUNC('month', DATEADD('month', -1, TODAY()))
THEN SUM([Sales]) END
Does that work for you?
Yeah sorry I hadn't clicked Apply yet before copy/paste. You need to get rid of the SUM() after the THEN. When you drag it out into the viz it will sum it.
It seems I'm not understanding your situation or what you want to reach.
I need more information in order to give you a proper solution. Could you describe more want you want to accomplish and if possible a workbook with sample data set.
Create this calculation: DATETRUNC('month', [Order Date]) = DATETRUNC('month', DATEADD('month', -1, TODAY())) and put it on the filter shelf. Then put SUM(Customers R12) on the label shelf. What do you get now?
It would be helpful to see exactly what you're trying to accomplish. Between this post and this one: formula for using previous month for particular measure I think we've answered what you're asking for.
If you can't share exactly what you're doing then mock something up using superstore data. Then post that twbx workbook here so we can see what it is you need.
Dan & Ramon,
Thanks for all your time and support. Shawn's formula from the above post worked for me. Thanks a lot Shawn.
Dan & Ramon this is what i was trying to achieve- Pull out latest month number for selected measures. Apologies for not being clear in posting my requirement and once again i thank you all for your invaluable time.