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

Add a team# on date/time table

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

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
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

 

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
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

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

 

 

 

[DateDimension][DateDimension][TimeDimension][TimeDimension]

Hi @Anonymous,

 

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
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

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

HI @Anonymous,

 

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
If this post helps, please consider accept as solution to help other members find it more quickly.

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.