cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
paragchapre1
Helper I
Helper I

Get data from date slicer

Hello,

 

I have below employee sickness data.

 

2021-05-05 15_06_23-Employee Sick - Excel.png

 

 

 

 

 

 

 

 

 

 

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

 

2021-05-05 15_00_34-Untitled - Power BI Desktop.png

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

 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi @paragchapre1 ,


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:

v-yalanwu-msft_0-1620382398982.png

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.

View solution in original post

4 REPLIES 4
FrankAT
Super User II
Super User II

Hi @paragchapre1 

here is my solution for the reporting days:

 

07-05-_2021_12-36-46.png

 

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)

v-yalanwu-msft
Community Support
Community Support

Hi @paragchapre1 ,


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:

v-yalanwu-msft_0-1620382398982.png

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.

View solution in original post

amitchandak
Super User IV
Super User IV

@paragchapre1 , try like

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

I tried now but It's not working.

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors