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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Custom Calendar by Akvelon

Hi,

 

I'm trying to create a visual with custom calendar akvelon. I'm relatively new to PowerBI. I've connected a basic excel source with annual leave data. There are three main columns, which I'm trying to use(intially) are "from date", "to date" and "employee".

 

I've also created a new date table to match the ranges.

 

The aim is to display a user or users and their annual leave for the year. I cannot get the duration between "from date" and "to date". Any ideas/help would be welcome?

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @Anonymous ,

Power bi not support direct analysis date duration between two date fields, I'd like to suggest you create a bridge table with expand date range and link to original table.

Spread revenue across period based on start and end date, slice and dase this using different dates
Then you can use bridge table date as axis and original table amount as value to create visuals.

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

Hi Xiaoxin Sheng,

 

I have a custom table created already for dates, I just have one query, before using the dax statement to link the tables. Do I need create a a unique identifier to link both tables?

 

Currently on my employee table i have the below list and on the date table, I have one date column.

 

Do I need a custom column on both tables to link the tables, as per the below dax script?

 

EMPLOYEEDepartmentAbsence reasonFromdateUntildateworkdays

 

booking date range = 
VAR _calendar =
    CALENDAR ( MIN ( booking[dte_start] ), MAX ( booking[dte_finish] ) )
RETURN
    SELECTCOLUMNS (
        FILTER (
            CROSSJOIN ( booking, _calendar ),
            booking[dte_start] <= [Date]
                && booking[dte_finish] >= [Date]
        ),
        "uid_booking", [uid_booking],
        "Date", [Date]
    )

 Kind Regards,

James

Hi @Anonymous ,

Actually, you need to use unique fields and date fields to create that bridge table. (notice: unique field is used to link those tables)
According to your description, employee fields should be the relationship key of your tables.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.