Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Visualize workload per project/customer/product.

Hi,

 

I have a data set with the following columns

 

- Forecasted Start date of project

- Forecasted End date of project

- Actual Start date of project (blank if not started)

- Actual End date of project (blank if not ended)

- Number of personnel on project (split per category in separate columns)

In addition there are several parameters per row which is relevant for the end result when it comes to filtering/slicers etc... 

 

ProjectForecasted Start dateForecasted End dateActual Start dateActual End dateCustomerProductNumber of personnel on projectPersonnel category 1Personnel category 2Personnel category 3
107.03.201814.08.201801.03.2018 A14211
201.01.201831.12.201801.01.2018 A23012
330.03.201820.05.2019  B33300
419.08.201631.05.201720.08.201630.05.2017C36222

 

 

First of all i have unpivoted the personnel categories columns so that there is only one column with number of personnel.

 

ProjectForecasted Start dateForecasted End dateActual Start dateActual End dateCustomerProductPersonnel categorynumber of personnel
107.03.201814.08.201801.03.2018 A112
201.01.201831.12.201801.01.2018 A210
330.03.201820.05.2019  B313
419.08.201631.05.201720.08.201630.05.2017C312
107.03.201814.08.201801.03.2018 A121
201.01.201831.12.201801.01.2018 A221
330.03.201820.05.2019  B320
419.08.201631.05.201720.08.201630.05.2017C322
107.03.201814.08.201801.03.2018 A131
201.01.201831.12.201801.01.2018 A232
330.03.201820.05.2019  B330
419.08.201631.05.201720.08.201630.05.2017C332

 


My end goal is to be able to visualize the data (both forecast and actulas) in i.e stacked charts per day/month/quarter etc..

 

I.e. a bar chart per month that shows the number of people (on the project, per product, per customer) muliplied with the number of days in the month.

 

An example would be; values for February 2018 a stacked bar chart per personnel category would show 28 days for category 2 and 56 days for category 3. This because project 2 started on January 1st and is forecasted to end at December 31st. Since there is no end date it would just bring in the full month into the calculation. If for some reason project 1 had an end date of February 27th the values in the bar chart would be 27 and 54 days for category 2 and 3 accordingly.

 

The bar chart for April stacked by personnel category would show 

- 60 + 90 days for category 1. 60 from project 1 which have two personnel active in April, 90 days for project 3 which have 3 personnel active in April

- 30 + 30 days for category 2. 30 from project 1 and 30 from project 2

- 30 + 60 days fro category 3. 30 from project 1 and 60 from project 2.

 

 

My question is, am I on the correct path when it comes to the data modeling? I have though about unpivoting the date columns as well so that i only have two date columns; Start date and end date, and the Forecast/Actuals split as a column parameter. But i have not done this yet as im am 100% stuck when it comes to the time intelligence dax functions. 

 

Any help at all would be highly appreciated.

 

 

 

  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi Anonymous,

     

    Since you table store date in different columns as date range, I think time intelligence functions won't work for your scenario.

    In my opinion, I'd like to suggest create new tables to expand these date range.

     

    For example: Table formulas.

    Spoiler
    Forecast Detail Table = 
    VAR _calendar =
        CALENDAR (
            MIN ( Table2[Forecasted Start date] ),
            MAX ( Table2[Forecasted End date] )
        )
    RETURN
        SELECTCOLUMNS (
            FILTER (
                CROSSJOIN ( Table2, _calendar ),
                [Date] >= [Forecasted Start date]
                    && [Date] <= [Forecasted End date]
            ),
            "Project", [Project],
            "Product",[Product],
            "Customer", [Customer],
            "Personnel category",[Personnel category],
            "Date", [Date]
        )
    
    
    Actual Detail Table =
    VAR _calendar =
        CALENDAR ( MIN ( Table2[Actual Start date] ), TODAY () )
    RETURN
        SELECTCOLUMNS (
            FILTER (
                CROSSJOIN (
                    FILTER ( ALL ( Table2 ), [Actual Start date] <> BLANK () ),
                    _calendar
                ),
                [Date] >= [Actual Start date]
                    && [Date] <= MAX ( [Actual End date], TODAY () )
            ),
            "Project", [Project],
            "Product", [Product],
            "Customer", [Customer],
            "Personnel category", [Personnel category],
            "Date", [Date]
        )

     

     

    Then you can direct use above tables to analysis and operate with each day of date range.

     

    Regards,

    Xiaoxin Sheng

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

     

    Since you table store date in different columns as date range, I think time intelligence functions won't work for your scenario.

    In my opinion, I'd like to suggest create new tables to expand these date range.

     

    For example: Table formulas.

    Spoiler
    Forecast Detail Table = 
    VAR _calendar =
        CALENDAR (
            MIN ( Table2[Forecasted Start date] ),
            MAX ( Table2[Forecasted End date] )
        )
    RETURN
        SELECTCOLUMNS (
            FILTER (
                CROSSJOIN ( Table2, _calendar ),
                [Date] >= [Forecasted Start date]
                    && [Date] <= [Forecasted End date]
            ),
            "Project", [Project],
            "Product",[Product],
            "Customer", [Customer],
            "Personnel category",[Personnel category],
            "Date", [Date]
        )
    
    
    Actual Detail Table =
    VAR _calendar =
        CALENDAR ( MIN ( Table2[Actual Start date] ), TODAY () )
    RETURN
        SELECTCOLUMNS (
            FILTER (
                CROSSJOIN (
                    FILTER ( ALL ( Table2 ), [Actual Start date] <> BLANK () ),
                    _calendar
                ),
                [Date] >= [Actual Start date]
                    && [Date] <= MAX ( [Actual End date], TODAY () )
            ),
            "Project", [Project],
            "Product", [Product],
            "Customer", [Customer],
            "Personnel category", [Personnel category],
            "Date", [Date]
        )

     

     

    Then you can direct use above tables to analysis and operate with each day of date range.

     

    Regards,

    Xiaoxin Sheng

    • Anonymous's avatar
      Anonymous
      Not applicable

      Anonymous thanks, this is exactly what i was looking for. Very helpfull!