Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Single Date Slicer for Multiple Dates on Visual

Hello!

 

I have one table that contains 9 columns, 7 of which are dates. They are dates of an enrolment process. I need to create a visual (bar chart) that shows the count of the dates for each column for a definied period. I want to filter the visual using one date slicer. 

 

This is the table:

 

The visual I want to create needs to look something like the below:

 

What is the best method for inserting one date slicer to filter all the results? For example, I may want to see the activity of just one week in a month, or the last 3 months, 6 months etc.

 

Thank you!

  • parry2k's avatar
    parry2k
    6 years ago

    Anonymous this is what you need to do, which will take care of everything.

     

    Unpivot your table, in query editor, select your school column and right click, and select upivot other columns

     

    It will add two column, one attribute which will be your category and other column value which will be your dates

     

    Apply the changes, add calendar dimension in your model (many blog posts are there).

     

    On bar chart, use date/month/year on x-axis from calendar table, legend will be your attribute and value will be count of rows from your table.

     

    Now you can slicer and dice the data by date or by category.

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    sounds like you need to related a date/time table for each of your dates and then a master date/time table related to each one of those date/time tables.  Then you set your slicer on the month field of the master time table and use that month in the visualization.

     

    Wouldn't that work?

    • parry2k's avatar
      parry2k
      Icon for Super User rankSuper User

      Anonymous this is what you need to do, which will take care of everything.

       

      Unpivot your table, in query editor, select your school column and right click, and select upivot other columns

       

      It will add two column, one attribute which will be your category and other column value which will be your dates

       

      Apply the changes, add calendar dimension in your model (many blog posts are there).

       

      On bar chart, use date/month/year on x-axis from calendar table, legend will be your attribute and value will be count of rows from your table.

       

      Now you can slicer and dice the data by date or by category.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Thanks very much! This seems to be doing the trick!

         

        I do have an error message for two of the columns though:

         

        DataSource.Error: Microsoft SQL: The type of column "txtWithdrawnDate" conflicts with the type of other columns specified in the UNPIVOT list.
        Details:
        DataSourceKind=SQL
        DataSourcePath=xxx
        Message=The type of column "txtWithdrawnDate" conflicts with the type of other columns specified in the UNPIVOT list.
        Number=8167
        Class=16

         

        I have checked that the column type is Date/Time which it is. Do you know how I could solve this?


        Many thanks, much appreciated!

    • Anonymous's avatar
      Anonymous
      Not applicable

      whoops.  You can't have more than one active relationship on a field. So the unpivot method suggested by the other posters is the correct solution.

  • RobbeVL's avatar
    RobbeVL
    Icon for Impactful Individual rankImpactful Individual

    Hi,

     

    A good way to do this, would be to remodel your data.

    Try modelling your date columns to a single data column.

     

    Example:

    IDDateDateType
    12308/08/12Leaving Date
    12309/08/12Registered Date
    12310/08/12Enquire Date

     

    This way you'll be able to do a (Distinct)Count on ID, use DateType as Legend and Date as Axis.

     

    Let me know if you need any more help