5 Replies Latest reply on Aug 30, 2017 6:13 AM by haitham Farouk

# Percentage difference between two dates for the same measure

Hey Everyone,

How do I find the percentage difference between two dates for the same measure.

I have attached the workbook for reference.

When you open the workbook you see a bar chart dispaying the percentages of the measure.

The second class count of sales on Feb 26 2014 is 25% but on Feb 4th 2014 it is 33%.

The same way standard class count of sales is 66% on Feb 4th 2014 but on Jan 26th 2014 it is 77%

Now how do I find the difference between the percentages? I mean to ask how do I calculate 25%-33% or 66%-77%.

In short I want to calculate the percentage difference between today's(or latest date) - the previous date acccording to the data available.

Please Help!!!

Regards,

Sean

• ###### 1. Re: Percentage difference between two dates for the same measure

Hi,

Create two computed field based on table calculation function

Sales Percent

ZN(COUNT([Sales]) / TOTAL(COUNT([Sales])))

which on ship mode table across

and

Sales Percent Diff

ZN([Sales Percent]) - LOOKUP(ZN([Sales Percent]), -1)

which on table along

attached twbx shows that ...

• ###### 2. Re: Percentage difference between two dates for the same measure

Hi Haitham,

Thanks for your logic. It works well with the sample data of Superstore.

But the same logic is calculating something else for my report.

This is the percentage difference it is calculating according to my data.

Can you analyse as to why this is happening?

Thanks,

Sean.

• ###### 3. Re: Percentage difference between two dates for the same measure

Hi sean,

Can u send the Viz to review ....

• ###### 4. Re: Percentage difference between two dates for the same measure

Hey,

I can't as the data is confidential. Any way that I can anonymous the data???

Thanks,

Sean.

• ###### 5. Re: Percentage difference between two dates for the same measure

Hi,

I believe as it working with the sample it must work with the real data, you can change the field names, and remove the unnecessary column from the data source this will hide  the confidentiality, you can also remove part of the data ...

Best Regrads