Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Get data from date slicer

Hello,

 

I have below employee sickness data.

 

 

 

 

 

 

 

 

 

 

 

I created a date slicer based on From date to calculate sickness days and reporting days from date slicer

 

In the above example, I can get correct sickness days however I don't get the correct reporting period selected on the date slicer.

How can I create a measure to get the date selected in the date slicer?

 

Regards,

Parag Chapre

 

  • Hi Anonymous ,


    The information you have provided is not making the problem clear to me ,
    If you want to find the duration date, you could use DATEDIFF() :

     

    reporting days 1 =
    CALCULATE (
        DATEDIFF ( MIN ( [From date] ), MAX ( [From date] ), DAY ) + 1,
        ALLEXCEPT ( 'employee sickness', 'employee sickness'[Employee] )
    )
    

     

    if you want to find the count of sickdays that are not empty, you can use COUNT()

     

    reporting days= COUNT([Sick days])

     

    The final output is shown below:

    If this is still not what you want,please provide me with more details about your table and
    your problem or share me with your pbix file after removing sensitive data.

     

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Anonymous , try like

    countrows(filter(Table, not(isblank(Table[Sick Days]))))

    • Anonymous's avatar
      Anonymous
      Not applicable

      I tried now but It's not working.

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

    Hi Anonymous ,


    The information you have provided is not making the problem clear to me ,
    If you want to find the duration date, you could use DATEDIFF() :

     

    reporting days 1 =
    CALCULATE (
        DATEDIFF ( MIN ( [From date] ), MAX ( [From date] ), DAY ) + 1,
        ALLEXCEPT ( 'employee sickness', 'employee sickness'[Employee] )
    )
    

     

    if you want to find the count of sickdays that are not empty, you can use COUNT()

     

    reporting days= COUNT([Sick days])

     

    The final output is shown below:

    If this is still not what you want,please provide me with more details about your table and
    your problem or share me with your pbix file after removing sensitive data.

     

    Best Regards,
    Community Support Team_ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • FrankAT's avatar
    FrankAT
    Community Champion

    Hi Anonymous 

    here is my solution for the reporting days:

     

     

    Reporting days = DATEDIFF(MIN('Date'[From date]), MAX('Date'[From date]), DAY) + 1

     

    With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
    FrankAT (Proud to be a Datanaut)