cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TejaswiniDahat
Regular Visitor

Dax for counting operations between start & end date

Hi All, 

 

I have a table where start date & end date of operations is available, I want to display number of operations for all dates between those dates. 
(Cannot use cross join as it will create a heavy dataset)

OpeartionStart DateEnd Date
A1/21/20212/10/2021
B1/23/20211/26/2021
C1/27/20212/1/2021
D1/30/20212/3/2021

 

TejaswiniDahat_0-1618848219173.png

1 ACCEPTED SOLUTION
Jihwan_Kim
Community Champion
Community Champion

Hi, @TejaswiniDahat 

Please check the below picture and the sample pbix file's link down below.

 

Picture1.png

 

Operations Count =
CALCULATE (
COUNTROWS ( Operations ),
FILTER (
Operations,
Operations[Start Date] <= MAX ( Dates[Date] )
&& Operations[End Date] >= MIN ( Dates[Date] )
)
)

 

https://www.dropbox.com/s/7cagrbdsybbn5lr/tejas.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: https://www.linkedin.com/in/jihwankim1975/

View solution in original post

2 REPLIES 2
Jihwan_Kim
Community Champion
Community Champion

Hi, @TejaswiniDahat 

Please check the below picture and the sample pbix file's link down below.

 

Picture1.png

 

Operations Count =
CALCULATE (
COUNTROWS ( Operations ),
FILTER (
Operations,
Operations[Start Date] <= MAX ( Dates[Date] )
&& Operations[End Date] >= MIN ( Dates[Date] )
)
)

 

https://www.dropbox.com/s/7cagrbdsybbn5lr/tejas.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: https://www.linkedin.com/in/jihwankim1975/

View solution in original post

amitchandak
Super User IV
Super User IV

@TejaswiniDahat , refer to my blog for this

https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...



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!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors