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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
MoonAlligator
Helper I
Helper I

Workload by Month Based on Ship Dates (Revised)

Hi All,

 

Hopefully this request is more clear then the last one. 🙂 I have two data sources! One is a list of projects and their ship dates. The other is the estimated workload per month before the ship date happens. The relationship between the two tables is the Project Key column. What i want to do is create an area chart showing the total estimated workload for every month but I don't know how to make this work. Below are the two data tables:

 

Project NameShip DateProject Key
A9/1/2020High
B10/1/2020Low
C12/1/2020Low

 

Project KeyWorkload (-1 Month)Workload (-2 Month)Workload (-3 Month)
Low.5.6.6
Medium.6.81
High.711.2

 

Below is the chart I'm trying to create: 

 

MoonAlligator_0-1598560547480.png

 

I think this would be the final data table output:

 

MonthsTotal Workload
7/1/20201
8/1/20201.3
9/1/20201.2
10/1/20201.1
11/1/2020.5
12/1/20200

 

So for example, this will tell me for Project A in August, a month before the ship date, i'll have an estimated workload of .7 because it's a High on the project key. In July, I'll have an estiamted workload of 1.0 etc...Let me know if you have any questions!

 

Thanks

1 ACCEPTED SOLUTION

Here is a modified version that will make it easier for you to adjust.  This works with or without the project name on the legend.

 

Workload 2 = 
VAR d = SELECTEDVALUE(Milestones[Date]) // x axis date - enable "show items with no data"
VAR c = SUMMARIZE(Projects,Projects[Project Name],Projects[Ship Date]
,"WL",SWITCH(datediff(Projects[Ship Date],d,MONTH)
,-3,sum(Workloads[Workload (-3 Month)])
,-2,sum(Workloads[Workload (-2 Month)])
,-1,sum(Workloads[Workload (-1 Month)])
,0))
RETURN SUMX(c,[WL])

View solution in original post

8 REPLIES 8
lbendlin
Super User
Super User

Something like this?

 

lbendlin_0-1598582472204.png

lbendlin_0-1598582736392.png

 

Hi,

 

This is close to what I was looking for however, are you able to change the legend so it's not always by Project Name? Does there have to be a legend for this chart to work? 

Ah another thing is what if the ship date is not only on the 1st. Is there a rounding thing I can add to the formula?

yes, the solution works without the legend too. I just added that to allow you to validate the computation as it doesn't match your expected result.

 

You can switch from month to day granularity by using a real date table, and slightly modify the time difference checks.

Here is a modified version that will make it easier for you to adjust.  This works with or without the project name on the legend.

 

Workload 2 = 
VAR d = SELECTEDVALUE(Milestones[Date]) // x axis date - enable "show items with no data"
VAR c = SUMMARIZE(Projects,Projects[Project Name],Projects[Ship Date]
,"WL",SWITCH(datediff(Projects[Ship Date],d,MONTH)
,-3,sum(Workloads[Workload (-3 Month)])
,-2,sum(Workloads[Workload (-2 Month)])
,-1,sum(Workloads[Workload (-1 Month)])
,0))
RETURN SUMX(c,[WL])

Hi,

 

I noticed with this formula the column subtotal appears as 0. Is there anyway to fix this? For example i see the following when I create a data table:

 

ProjectOctNovTotal
A110
B210
C210
Total530

 

Thanks

A total across months makes little sense in that scenario. Remove the column total display.

Thanks for your help! The modified version gives me what I was looking for. I'll reach out if I have any follow-up questions. 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.