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

Total for period within a date range

Hi,

 

I have a table with a number of rows that display start date, end date and the total number of days in between the two. I would like to be able to dynamically filter the table so that it would just give me the number of days in, for example, the quarter from 1st July 2018 to 30th September 2018. The result for this quarter using the following table ought to be 40. I thought this would be straightforward, but I'm struggling to make it work.

 

Date FromDate ToNumber of days
12/01/200119/03/200166
14/01/200211/03/200256
13/04/201026/04/201013
15/10/201229/10/201214
19/11/201322/11/20133
22/11/201305/02/201475
29/06/201809/07/201810
09/07/201810/08/201832
28/03/201916/05/201949
16/05/201903/10/2019140
1 REPLY 1
jthomson
Solution Sage
Solution Sage

So you're getting 40 on account of 8 from row 7 and 32 from row 8, yes? I would guess there's a way to do it in DAX, but I'd look to a Power Query solution as an alternative, and convert it into a single column with one row for each date between your date from and date to columns, which you can then count the rows of to get your answer. It's a fairly common thing to do, if you search list all dates between two dates you should get your answer

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.

Top Solution Authors