Forum Discussion

MIKAOKSA's avatar
MIKAOKSA
Icon for Helper I rankHelper I
6 years ago
Solved

Double date slicer (date table)

Hi, 

 

I have a model with date table created with calendar auto and two different tables I want to filter with this date:

 

There is a relationship with REP_EMPORATWR_MV[END_ACTUAL] and Dates[date] and with Sheet 2[event date] and Dates[date]. Also both tables are linked with EMPID through DLG_EMPLOYEE_V. I have created a filter which uses the Date[date], but the problem is it doesnt seem to work like it should. For example Sheet 2[EMPWRKHOURS] is not right:

Slicer is set to one day 1.11. to 2.11. so any employee should not have more than 24 hours (in reality 7 to 9 hours), but the values are way off. Previosly I did not have a date table and tried to do this with USERELATIONSHIP but that did not work either. I was sure this model would work but not even close, and I'm stuck. Please help!

 

BR, Mika

  • Hi MIKAOKSA 

    I don't know what should be the correct value for your visual.

    When looking into your data model, i find the [END_ACTUAL] is of datetime format, it is wrong to use this datetime column to relate the "date" table.

    You need to create a "date" column from [END_ACTUAL] in date format.

    You can also change the relationship among "REP_EMPOPERATWR_MV" and other tables to both, then check if it would show correct result.

     

    Best Regards

    Maggie

7 Replies

  • v-juanli-msft's avatar
    v-juanli-msft
    Icon for Community Support rankCommunity Support

    Hi MIKAOKSA 

    when slicer is set to 2019/11/1~2019/11/2, it filters 2 days.

    Sheet2[EMPWRKHOURS] seems show the correct result as the slicer filters.

     

    What's wrong do you find and what's expected result do you like?

     

    Best Regards

    Maggie

    • MIKAOKSA's avatar
      MIKAOKSA
      Icon for Helper I rankHelper I

      Hi Maggie!

       

      The problems begin when I try to put them in combined table with the other sheets and filter them both with the same date filter:

      This should show the same results as your example which you did but it doesnt.

      • MIKAOKSA's avatar
        MIKAOKSA
        Icon for Helper I rankHelper I

        Hi, 

         

        this is still a problem, can anyone help? The data is downloadable above. Everything filters ok when I use tables Date, Sheet 2 and DLG_employee_V but when I try to add something from REP_EMPORATW it just fails to give any results. 

         

        Mika