cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Coan7 Helper IV
Helper IV

Count between from and to date

Hi, 

 

I need to show in a table/matrix the days someone is gone based on from and to date:
Dataset includes datetable.

 

The dataset looks somewhat like this (3 columns):
Person    from               to
1             03.02.2020     07.02.2020
2             04.02.2020      07.02.2020

Desired matrix:
Weeknr 6  
day                Mon   Tue    Wed    Thu   Fri    Sat  Sun
person 1        1          1        1         1        1           
person 2                    1         1         1        1        



 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Count between from and to date

You want a modification of Open Tickets. https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/td-p/409364


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

4 REPLIES 4
Super User IV
Super User IV

Re: Count between from and to date

Refer this blog can help to deal with between date. Now instead of count of employee take sum of weekday

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...





Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
In case it does not help, please provide additional information and mark me with @
My Recent Blog -Week is not so Weak Proud to be a Super User! Connect on Linkedin


Super User IV
Super User IV

Re: Count between from and to date

You want a modification of Open Tickets. https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/td-p/409364


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

Super User IV
Super User IV

Re: Count between from and to date

Hi @Coan7 

 

Please see the attached file with a solution in Power Query.

 

Table - you sample 

Table ( referenced ) - Table referenced to Table and Transformed to expand dates ( Added Colum step )

Calendar - list of dates + weekday column ( date dimension )

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Coan7 Helper IV
Helper IV

Re: Count between from and to date

@Mariusz, nice solution with power query.

See dax solution by Greg_Dekler.

You want a modification of Open Tickets. https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/td-p/409364

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors