8 Replies Latest reply on Sep 7, 2018 8:27 AM by Ankit Patel

# Side By Side Bar Chart with Custom Dimension

I'm somewhat new to tableau but getting better by the day. What I've been asked to do is create something of a checkout funnel with three steps of the funnel each displayed as Last Week, Last 4 Weeks, and Year to Date. Here's an image of the visualisation in Excel:

I've got it set up as a bar chart currently but not sure how to go about adding the different time periods to the viz:

I'm thinking I need to create a custom dimension to add after "Measure Names" but I'm just not sure how to go about making that.

Thanks in advance for the help.

Cheers,

• ###### 1. Re: Side By Side Bar Chart with Custom Dimension

Could you please attach sample data as twbx.

Thanks,

Shin

• ###### 2. Re: Side By Side Bar Chart with Custom Dimension

Hi Geoffrey,

You will need to create 3 calculations to determine the value of each bucket (Current Week, Last 4 Weeks, & YTD) respectively. Once you do this you can plug them into the view and create the view as you have in Excel.

Current Week: IF (DATEDIFF('week',[Date],TODAY()))<=1 THEN [Volume] END

Last 4 Weeks: IF (DATEDIFF('week',[Date],TODAY()))<=4 THEN [Volume] END

YTD: IF (DATEDIFF('year',[Date],TODAY()))<=0 then [Volume] END

Workbook attached with these calcs.

If you find it useful, then please mark this answer Correct, this way others can benefit from it. Thank you!

Best regards,

Ankit

1 of 1 people found this helpful
• ###### 3. Re: Side By Side Bar Chart with Custom Dimension

This looks promising. Will try this tonight and let you know how it works.

• ###### 4. Re: Side By Side Bar Chart with Custom Dimension

Did it work?

• ###### 5. Re: Side By Side Bar Chart with Custom Dimension

Hi Ankit,

Thanks so much for offering this solution. The problem I am running into is that your solution has a single Dimension (behavior) that you are tossing into Columns. My data is a little less simple and each 'behavior' is it's own Measure. I am calculating the percentages as 'carts / users', 'order details / users', and 'transactions / users'.

I've attached a sample csv of what my dataset looks like.

Cheers,

• ###### 6. Re: Side By Side Bar Chart with Custom Dimension

Hi Geoffrey,

There isn't a way to Create a Dimension for what you are looking to achieve. Is your Data allowing you to Pivot in order to achieve this?

Normally you should do the Pivot upfront - in Connect Data window of the dataset allows it or via Custom SQL.

Let me know. Thank you.

• ###### 7. Re: Side By Side Bar Chart with Custom Dimension

Thanks Ankit. Sounds like my best course is to set up a new data source that is better suited to this view. I'll work on that.

In the mean time I'm going to mark your first answer as correct since I think that will work for most people.

Cheers,

• ###### 8. Re: Side By Side Bar Chart with Custom Dimension

Sounds good.