Forum Discussion

ChrisR22's avatar
ChrisR22
Helper III
2 years ago

Using a Table with Multiple Date Fields

Hello,

 

I have a table that has mutiple date fields:

Project Table:

requested completion dateinitiation datecompletion datedelivery date

along with several other columns relating to the projects listed

 

And I would like to use these all in separate visuals, however have a single slicer that will act on all of them. My thinking would be to make many-to-one relationships between each of these date columns and a single date column of my Calendar table. 

Calendar table:

date (MM/DD/YY)

 that has many other columns further breaking down date (Month #, Day Name, Day of Week, etc.)

 

The only issue with this is, when creating visuals, I cannot get date heirarchies for those fields. I would need to use the Date column from the Calendar table in my visual, but because all of those Project date columns have a relationship with this one Calendar date column it would lead to an issue because there wouldn't be a way to specify which relationship (and which date) I want to use in that particular visual.

Ex.

graph over time

x-axis: Completion dates

y-axis: volume of projects completed

 

Has anyone thought of a good workaround, a way to display a variety of visuals from a table that has multiple date fields while still being able to use a single slicer for all dates?

 

5 Replies

  • Ah, the good-old multiple dates problem 🙂

     

    Depending on your use case (what do you want to achieve) there might be variety of possible solutions (each and every requires measures to write):
    1. Creating Multiple Inactive Relationships and specify relation (USERELATION) for each measure => e.g:

    Volume of projects (BY DATE COMPLETED) = Calculate(COUNT(Projects[Id],USERELATIONSHIP(Calendar[Date],Projects[CompletedDate])

    2. Do not use relationship at all but use filter in each measure:

    Volume of projects (BY DATE COMPLETED) = Calculate(COUNT(Projects[Id], CompletedDate <= Max(Calendar[Date]) && CompletedDate >= Min(Calendar[Date])

    The second approach is more flexible allowing for combining dates conditions.

     

    ...

    There are more solutions, each depending on your use case. Can you paste the mockup of the report and explanation of how slicer should work?

    • ChrisR22's avatar
      ChrisR22
      Helper III

      Hey jeremic_nikola  thanks for the response, here are the tables I'm working with:

      Project Table

      Project NameClientEstimated HoursWorking HoursProject ManagerRequested Completion DateInitiation DateCompletion Date
      AppleApple11521Joe10/1/20239/1/202310/5/2023
      OrangeOrange13548Jane8/30/20237/15/20239/15/2023
      BananaBanana154Bob11/1/20238/15/202310/25/2023

       

      Here is a snippet of my calendar table

      DateYearMonth NameMMMMonthDay NameDDDDay of WeekYYMMMonthIDWorking DayStartEnd
      1/1/20212021JanuaryJan1FridayFri6210137311/1/21 8:00 AM1/1/21 5:00 PM
      1/4/20212021JanuaryJan1MondayMon2210137311/4/21 8:00 AM1/4/21 5:00 PM
      1/5/20212021JanuaryJan1TuesdayTues3210137311/5/21 8:00 AM

      1/5/21 5:00 PM

       

      I am intending for the slicer to work universally. It will be a between dates slicer, and all graphs in the canvas that use dates should be controlled by the two between dates of this single slicer. 

       

      I am hoping to do more than just volumn, and to work with data that relates to the project managers, clients, etc. 

      • jeremic_nikola's avatar
        jeremic_nikola
        Frequent Visitor

        Ok and how your report should look like?

        When you choose dates, shoud the filter behave like OR condition between any of the dates?

         

        What do you mean by universally?