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
Andrew17
Helper I
Helper I

Date filter across multiple different date fields

Hi,

 

I have data in a table like below: 

 

Unique IDStatus 1 Start DateStatus 1 End DateStatus 2 End DateStatus 3 End DateStatus 1 TimeStatus 2 TimeStatus 3 Time
AA4/29/20204/30/20205/1/20205/3/20201.001.002.00
AB4/23/20204/25/20204/28/20204/30/20202.003.002.00
AC4/19/20204/20/20204/22/20204/24/20201.002.002.00
AD4/19/20204/29/20205/1/20205/3/202010.002.002.00
AE4/23/20204/25/20204/28/20204/29/20202.003.001.00
AF4/19/20204/20/20204/21/20204/24/20201.001.00

3.00

 

I want to be able to summarize how many Unique IDs were completed in a specific time period for all 3 statuses, and also find on average how long it took in that time period. 

 

So I am trying to create a date slicer that can calculate it for all statuses at the same time.

 

So for example, if I had a date slicer set to 4/28/2020 to 5/1/2020:

Count_1 = 2

Count_2 = 4

Count_3 = 2

 

Avg_Time_1 = 5.5

Avg_Time_2 = 2.25

Avg_Time_3 = 1.5

 

Is something like this possible?

 

Thanks,

Andrew

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Andrew17 ,

 

Create an unrelated calendar table as slicer then create measure like this:

Count_1 = CALCULATE(COUNT('Table'[Unique ID]),FILTER('Table','Table'[Status 1 End Date] in VALUES('Table 2'[Date])&&'Table'[Status 1 Start Date]<=MAX('Table 2'[Date])))

test_date_filter.PNG

Sample .pbix 

 

Best Regards,
Liang
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

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @Andrew17 ,

 

Create an unrelated calendar table as slicer then create measure like this:

Count_1 = CALCULATE(COUNT('Table'[Unique ID]),FILTER('Table','Table'[Status 1 End Date] in VALUES('Table 2'[Date])&&'Table'[Status 1 Start Date]<=MAX('Table 2'[Date])))

test_date_filter.PNG

Sample .pbix 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you this worked for what I was trying to build! 🙂 

amitchandak
Super User
Super User

@Andrew17 , One way is to unpivot this table https://radacad.com/pivot-and-unpivot-with-power-bi

 

Second way is to join all dates to a common date table and use userelation as per need. Only one can be active at a time.

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

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

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.