3 Replies Latest reply on Sep 6, 2018 5:57 PM by Zhouyi Zhang

    Percent Difference Over Time Across Multiple Measurements (10.5)

    Simon Zhang

      Please allow me to thank you for your time. This is my first time posting on the forum, however I've looked extensively into the feasibility of my request and have come up short. This could be due to poor search criteria or--what I'm hoping isn't the case--that Tableau simply isn't built to handle this ask.


      Here's the view I'm looking at. I've attached a packaged workbook (it's just the sample superstore data) herein.



      What I'm looking to achieve is a 3rd column that serves as a difference column. The WoW calculations are (which I pulled from Displaying Table Calculation as own Column ):


      Profit (WoW Same Day)


      { SUM(IIF(datepart('week',[Order Date]) = { MAX(datepart('week',[Order Date])) }, [Profit], NULL)) }


      { SUM(IIF(datepart('week',[Order Date]) = { MIN(datepart('week',[Order Date])) }, [Profit], NULL)) }


      Profit (WoW Same Day Final)


      IIF(COUNTD(datepart('week',[Order Date])) > 1, SUM([Profit (WoW Same Day)]), SUM([Profit]))


      I'm running into 2 issues:


      1. The issue works at the level of detail currently in the view, but breaks when I put "State" in Rows

      2. I can't get the calculation to work for an aggregated measurement such as Profit per Unit Quantity


      I'm not looking to do is display two separate sheets side by side, one with the weekly numbers and the second with the % difference. It would work if Tableau had a synchronized scroll capability but I can't display everything in one scroll-free view.


      I've read through Interwork's LOD tutorial and the Tableau whitepaper and can't figure it out.


      Thank you for your time!