4 Replies Latest reply on Nov 20, 2017 10:49 AM by Deepak Rai

# Comparing a Dimension between two measures

Hello All,

The Setup: I have a dimension with product names and its sales for two Sundays as two different measures.

The Requirement: I need to compare the product names by the difference between the measures and generate a result.

I am attaching an example workbook, so I need to compare the sales for Current Sunday vs the Previous Sunday for all the products.

• If value of Current Sunday > value of Previous Sunday then I would like to display "Good" across that particular product name
• If value of Current Sunday < value of Previous Sunday then I would like to display "Update Sale" across that particular product name

or (if this is possible to do it will help me a lot)

• If value of Current Sunday < value of Previous Sunday and the difference is more than 10% then I would like to display "Update Sale" across that particular product name

Regards,

Manohar

• ###### 1. Re: Comparing a Dimension between two measures

Hi Manohar,

Check Screenshot and attached.

Thanks

Deepak

1 of 1 people found this helpful
• ###### 2. Re: Comparing a Dimension between two measures

Hello Deepak,

Thank you for the quick reply, looks like the solution I was looking for. If you do not mind can you please explain to me how you did the DIFF part and the Update part? so that I can learn to do it as well.

• ###### 3. Re: Comparing a Dimension between two measures

Edit: Did not see the attached solved workbook. That answers my question, thanks a lot Sir.

• ###### 4. Re: Comparing a Dimension between two measures

Hi Manohar

This is the Calculation for Difference

FORMULA is (p2-p1)/p1

(SUM([Current Sunday])-SUM([Previous Sunday]))/SUM([Previous Sunday])

Then I wrote this 2nd calculation for Update, Drageed it to Color and changed Shape to Square and SIZE to Full

IF SUM([Current Sunday])<SUM([Previous Sunday]) and [DIFF]<= -0.1

THEN

"UPDATE SALE"

ELSE"OK"

END

Hope this Helps!!