Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Date slicer - multiple visualizations with different date types?

Here is what I'm working with

 

2 tables; a standard calendar table and a employee table.  The employee table has both a hire date and a separation date (this column has some blanks in it due to not every employee is separated)

 

I would like to have a date slicer using the calendar table to show say how many employees were hired in April and how many left the company in April.

 

Since I can only have one active relationship, I can't get visualizations to work at the same time for both the hire date and separation date.

 

Is there a way to make this possible?

3 Replies

  • v-frfei-msft's avatar
    v-frfei-msft
    Community Support

    Hi Anonymous ,

     

    One sample for your reference, please check the following steps as below.

    1. Create relationship between tables as below.

     

    2. Create two measures to get the excepted result we need.

     

    hire in = COUNTROWS(Table1)
    sep = CALCULATE(COUNTROWS(Table1),USERELATIONSHIP('Table'[Date],Table1[separation date]))

     

    Pbix as attached.

    • Anonymous's avatar
      Anonymous
      Not applicable

      v-frfei-msft   on one of your tables, you have 3 separation dates in April but the card only shows 1.  Is that because 2 of them also have a hire date in April?

       

      I would like for both cards to count all hire dates and all separation dates and not cancel each other out if the hire and separation date was all in the same month if that is what is happening

      • v-frfei-msft's avatar
        v-frfei-msft
        Community Support

        Hi  Anonymous ,

         

        Kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.