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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ChrisR22
Helper III
Helper III

Using a Table with Multiple Date Fields

Hello,

 

I have a table that has mutiple date fields:

Project Table:

requested completion dateinitiation datecompletion datedelivery date

along with several other columns relating to the projects listed

 

And I would like to use these all in separate visuals, however have a single slicer that will act on all of them. My thinking would be to make many-to-one relationships between each of these date columns and a single date column of my Calendar table. 

Calendar table:

date (MM/DD/YY)

 that has many other columns further breaking down date (Month #, Day Name, Day of Week, etc.)

 

The only issue with this is, when creating visuals, I cannot get date heirarchies for those fields. I would need to use the Date column from the Calendar table in my visual, but because all of those Project date columns have a relationship with this one Calendar date column it would lead to an issue because there wouldn't be a way to specify which relationship (and which date) I want to use in that particular visual.

Ex.

graph over time

x-axis: Completion dates

y-axis: volume of projects completed

 

Has anyone thought of a good workaround, a way to display a variety of visuals from a table that has multiple date fields while still being able to use a single slicer for all dates?

 

5 REPLIES 5
jeremic_nikola
Frequent Visitor

Ah, the good-old multiple dates problem 🙂

 

Depending on your use case (what do you want to achieve) there might be variety of possible solutions (each and every requires measures to write):
1. Creating Multiple Inactive Relationships and specify relation (USERELATION) for each measure => e.g:

Volume of projects (BY DATE COMPLETED) = Calculate(COUNT(Projects[Id],USERELATIONSHIP(Calendar[Date],Projects[CompletedDate])

2. Do not use relationship at all but use filter in each measure:

Volume of projects (BY DATE COMPLETED) = Calculate(COUNT(Projects[Id], CompletedDate <= Max(Calendar[Date]) && CompletedDate >= Min(Calendar[Date])

The second approach is more flexible allowing for combining dates conditions.

 

...

There are more solutions, each depending on your use case. Can you paste the mockup of the report and explanation of how slicer should work?

Hey @jeremic_nikola  thanks for the response, here are the tables I'm working with:

Project Table

Project NameClientEstimated HoursWorking HoursProject ManagerRequested Completion DateInitiation DateCompletion Date
AppleApple11521Joe10/1/20239/1/202310/5/2023
OrangeOrange13548Jane8/30/20237/15/20239/15/2023
BananaBanana154Bob11/1/20238/15/202310/25/2023

 

Here is a snippet of my calendar table

DateYearMonth NameMMMMonthDay NameDDDDay of WeekYYMMMonthIDWorking DayStartEnd
1/1/20212021JanuaryJan1FridayFri6210137311/1/21 8:00 AM1/1/21 5:00 PM
1/4/20212021JanuaryJan1MondayMon2210137311/4/21 8:00 AM1/4/21 5:00 PM
1/5/20212021JanuaryJan1TuesdayTues3210137311/5/21 8:00 AM

1/5/21 5:00 PM

 

I am intending for the slicer to work universally. It will be a between dates slicer, and all graphs in the canvas that use dates should be controlled by the two between dates of this single slicer. 

 

I am hoping to do more than just volumn, and to work with data that relates to the project managers, clients, etc. 

Ok and how your report should look like?

When you choose dates, shoud the filter behave like OR condition between any of the dates?

 

What do you mean by universally?

- could you clarify what you mean for this first question?

- i'm intending to have a slicer where I select any two dates and all charts will only represent data between those two dates. for example a chart showing volume of projects based on completion date over time would show only between dates A and B in the slicer, and an ajacent chart showing volumn of projects based on initiation date over time would also onnly show between dates A and B.

Oh that - this is easy - just apply solution 1 (by specifying USERELATIONSHIP in measures) and you will get it:
CHART 1 - This Measure: Volume of projects (BY DATE COMPLETED) = Calculate(COUNT(Projects[Id],USERELATIONSHIP(Calendar[Date],Projects[CompletedDate])
CHART 2 - This Measure: Volume of projects (BY DATE INITIATED) = Calculate(COUNT(Projects[Id],USERELATIONSHIP(Calendar[Date],Projects[InitiatedDate])
....

So, to summarize:

1. Create INACTIVE Relationships between Calendar Date and each date column you want to do breakdowns

2. Create MEASURES for each chart you want (by completed date, initiation date etc...)
3. Put respective measures in respective charts

4. Put ONE Slicer with Calendar Date
5. Enjoy....

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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