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
JBI1250
Regular Visitor

Trying to track % complete over time and contrast with past periods in line graph

Hi All, I'm trying to figure out the measures/variables that I need to create a visual that tracks progress over time and contrasts it against previous years.

 

Here's a sample of my data

Task YearTask Start DateTask IDTask StatusDate CompletedNote
2022Apr-01-20221Active Task uncomplete
2022Apr-01-20222Complete05/25/2022Should count for 2022
2022Apr-01-20223Complete07/30/2022Should count for 2022
2021Apr-01-20211Complete04/19/2022Completed after Mar 31st year-end, should not count for % complete for 2021 or 2022
2021Apr-01-20212Complete08/08/2021Should count for 2021
2021Apr-01-20213Complete10/04/2021Should count for 2021
2020Apr-01-20201Active Task uncomplete
2020Apr-01-20202Complete02/20/2020Should count for 2020
2020Apr-01-20203 12/15/2022Completed after Mar 31st 2020 year end, should not count for % complete for 2020 or 2022

 

Here's an example of what I'm hoping to accomplish-

 

chart example.png

 

So there are a few things to note-

  1. Some tasks are unfinished and do not have a date-completed value. I have tried relating my calendar table to both the Start Date and End Date columns, but both have been problematic.
  2. Some tasks are completed in later years, but I only want to track the progress of tasks in the given task year.
  3. The calendar year is nonstandard and runs from Apr 1 to Mar 31

I think I need 3 measures/variables:

  1. One that counts the total number of tasks assigned for a given task year... TaskCount=Calculate(Countrows(My Table),...Filter or something?
  2. One that sums up the number of tasks completed over time for a given year. I've been closest with this one i think, but it doesnt aggregate or sum... Complete = CALCULATE(COUNTROWS(Stats),FILTER(Stats,[Task Status]="Complete"))
  3. One that calculates the % of total annual tasks completed as the year progresses.... %Complete= DIVIDE(Complete, TaskCount)

The problems I've been having-

  1. I was trying different variations of COUNTROWS to get my total task count but was having problems due to the chart's X axis being months. I was also having problems using my date table in this way. I think I need a variable based on a measure that counts the number of tasks for each task year and holds that value constant to use later in the % complete measure.
  2. In the charts and tables I've been experimenting with so far, I can get the number of tasks completed in each month, but not as a running total for a nonstandard calendar year (Apr-Mar), which is the value I will need to calculate and display the % change by month as the year progresses.
  3. I can get this measure to work as a yearly total just by dividing measure 2 (completed task count) by measure 1 (total task count), but as soon as I try to incorporate the monthly timeline it all falls apart.

 

Any assistance or direction would be greatly appreciated!

Thanks

 

3 REPLIES 3
JBI1250
Regular Visitor

Hi Xiaosun, i've implemented your suggestions, but it doesn't quite seem to be working as expected.

 

When i link my Date table to the Start Date field in my fact table, i get the annual totals, but don't seem able to get a running monthly total.

JBI1250_0-1664379087136.png

 

JBI1250_1-1664379223739.png

When i switch the relationship from start date to date completed, i get a monthly breakdown, but it appears that it's all the 2019 annual total and not a running/compounding/aggregating total based on year and month...

JBI1250_2-1664379355185.png

 

Interestingly, the line graph seems to be showing the correct annual or current % complete totals based on task year (ie. 2022 is down at around 24%, while 2019 is up at 90%), it's just not showing the rate of completion progressing over the months.

 

The matrix on the left isn't displaying the correct totals for each year (only 2019 it appears), but i think this is because I'm using my date table as the source for the Rows, whereas i'm using Task Year for the Legend in the line graph...

 

JBI1250_3-1664379939709.png

 

JBI1250_4-1664379953744.png

Thanks again for your help! 🙂

JBI1250
Regular Visitor

Thanks so much for your response!

 

The line chart is meant to track the progress over the year as tasks are completed, so at the beginning of the year (april) we would start of with a set number of tasks for the year, say 300. Every time we complete a task, we record the date the task was completed. As the year progresses and more tasks are completed, the % of completed tasks relative to the total number of tasks increases and that is what I'm trying to display with the line chart. So for example, by June, maybe we've completed 10% of the tasks for 2022 and maybe 20% by July. I'd like to be able to contrast against previous year's progress to show how the current pace compares with previous years.

 

I hope that provides some further clarity, but if that's not what you were looking for, please let me know and please let me know specifically what other info or explanation i can offer 🙂

 

Thanks again and I will attempt to implement your solution asap and let you know if it solved my issues!

v-xiaosun-msft
Community Support
Community Support

Hi @JBI1250 ,

 

According to your description, here is my solution.

Create a column to meet your request1:

Column =
CALCULATE (
    COUNT ( 'Tabelle1'[Task ID] ),
    FILTER ( 'Tabelle1', 'Tabelle1'[Task Year] = EARLIER ( Tabelle1[Task Year] ) )
)

Create another column to meet your request2:

Column 2 =
CALCULATE (
    COUNT ( 'Tabelle1'[Task ID] ),
    FILTER (
        'Tabelle1',
        'Tabelle1'[Task Year] = EARLIER ( Tabelle1[Task Year] )
            && 'Tabelle1'[Task Status] = "Complete"
    )
)

Create a measure to meet your request3:

Measure =
DIVIDE ( MAX ( [Column 2] ), MAX ( [Column] ) )

 Final output:

vxiaosunmsft_0-1664360279845.png

Can you describe the basis of the line chart in more details to better solve your problem?

 

Best Regards,
Community Support Team _ xiaosun

If this post helps, then please consider Accept it as the solution to help the 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.

Top Solution Authors