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
Henrik_PBI
Helper II
Helper II

Percentage of tasks done: Create a measure that takes next week values into account

Hi,

 

My data concists of work orders. For each week I count the number of work orders that are planned for the upcoming week ("planned") and the number of work orders that were planned last week, but not completed ("expired"). My table looks like this:

 

Community1.png

 

I need to create a measure that shows the percentage of work orders done, which takes into account the number of work orders that were not completed (shown as expired the next week). 

 

What I suppose it should look like:

Community2.png

I guess it is an easy solution to this, but I run into trouble when I try to create the measure for week n-1.

Anyone able to help me on this?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Henrik_PBI ,

Assuming you have task time. Have a separate Week /date table with Week or week Rank.

 

Column

Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)

 

measures
This Week = CALCULATE(sum('Table'[Tasks]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])) && Task[Type] = "Expired")
Last Week = CALCULATE(sum('Table'[Tasks]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

Percent = Divide([Last Week] -[this Week],[last Week])

 

refer

https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Henrik_PBI ,

Assuming you have task time. Have a separate Week /date table with Week or week Rank.

 

Column

Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)

 

measures
This Week = CALCULATE(sum('Table'[Tasks]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])) && Task[Type] = "Expired")
Last Week = CALCULATE(sum('Table'[Tasks]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

Percent = Divide([Last Week] -[this Week],[last Week])

 

refer

https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

Thank you, @amitchandak  - this seem to work!

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.