cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
olbom1 Frequent Visitor
Frequent Visitor

Add a team# on date/time table

I would like to know if anybody have done this before, or how youd do it Smiley Happy

I have a normal date table who have a different day on each row.

I also have a Timetable who have a different minute on each roe and a dateID to connect the 2 date/time tables.

 

I would like to add a team# on the time/date relation.

There`s 4 teams A,B,C and D who work on a 7/7 Day and Night schedule.

 

If i know that team A start next wednesday (26-12-2018 for example) at Day and B at Night
AND C will start at Day and D at night on 02-01-2019.

 

I also have to say that day shift starts at 7am and end at 7pm and night shift start at 7pm and end at 7am.

 

How would you right the formula to scroll it down on my date/time table ?

 

 

Thank you very much.

5 REPLIES 5
Community Support Team
Community Support Team

Re: Add a team# on date/time table

Hi @olbom1,

 

I'd like some sample to help us clarify your requirement. It is hard to code formula without any sample data.(table structure and relationship)

How to Get Your Question Answered Quickly


Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
olbom1 Frequent Visitor
Frequent Visitor

Re: Add a team# on date/time table

This is my 2 tables : there is no relation between de two of them.

 

 

 

Capture.PNG[DateDimension]Capture1.PNG[TimeDimension]

Community Support Team
Community Support Team

Re: Add a team# on date/time table

Hi @olbom1,

 

I create two bridge table to link #team table with date and time.

 

#Team table:

16.PNG

 

Date Bridge =
SELECTCOLUMNS (
    FILTER (
        CROSSJOIN ( '#Team', DateTable ),
        [Date] >= [StartDate]
            && [Date] <= [EndDate]
    ),
    "Team", [Index],
    "Date", [Date]
)


Time Bridge = 
SELECTCOLUMNS (
    FILTER (
        CROSSJOIN ( '#Team', TimeTable ),
        IF (
            [StartTime] <= [EndTime],
            [Time] >= [StartTime]
                && [Time] <= [EndTime],
            [Time] >= [StartTime] && [Time]<=TIME(0,0,0)
                || [Time] <= [EndTime]&& [Time]>=TIME(0,0,0)
        )
    ),
    "Team", [Index],
    "Time", [Time]
)

 

Relationship:

17.PNG

 

Visuals:

18.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
olbom1 Frequent Visitor
Frequent Visitor

Re: Add a team# on date/time table

Thank you very much for your code,
How would you code it to be running all over the year and perpetual.

 

I mean the team 1,2 & 3,4 will continue to alternate over the year ?

Thank you, olbom1

Community Support Team
Community Support Team

Re: Add a team# on date/time table

HI @olbom1,

 

Actually, after I create expand bridge tables and link them. Original table record can be mapping with detail records (data range is defined by multiple columns in same row).

 

When you use date/time tables with original table fields, it will auto summarize records based on relationship.

 

I attached sample pbix file below.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 337 members 3,690 guests
Please welcome our newest community members: