Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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 @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:

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
Community Champion
Community Champion

Hi @Anonymous 

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 @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:

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.

amitchandak
Super User
Super User

@Anonymous , try like

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

Anonymous
Not applicable

I tried now but It's not working.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.