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
Anonymous
Not applicable

Week To Date Measure Not Working

Hi,

 

I have created a measure below to calculate the week to date OEE rate. Somehow it couldn't show up anything (no errors). I have also attached what the date table looks like and the measures to calculate "Units" and "Planned Units Calc". Is this someone that have come across and able to help me with?

 

jimmyzyrzyr_0-1637535967710.png

jimmyzyrzyr_1-1637536081536.pngjimmyzyrzyr_2-1637536096379.pngjimmyzyrzyr_3-1637536106304.png

 

Much thanks,

JZ

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @Anonymous ,

You can try to add the all() function to the dax formula:

WTD OEE=
var CurrentDate=Max(‘99 Date Table’[Date])
var CureentWeek=Max(‘99 Date Table’[Week])
Return
CALCULATE(DIVIDE([Units],[Planned units calc])),
All(’99 Date Table’[Date)
’99 Date Table’[Date] <= CurrentDate,
’99 Date Table’[Week]=CurrentWeek)

https://docs.microsoft.com/en-us/dax/all-function-dax

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@Anonymous , refer my blog for that, you need additional column in date table

 

Power BI — Week on Week and WTD
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-Last-Week/ba-p/1051123
https://www.youtube.com/watch?v=pnAesWxYgJ8

 

 

Weekday = WEEKDAY([Date],2)

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)

 

 

Measures like

 

WTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank]) && 'Date'[WeekDay]<=max('Date'[WeekDay])-1))
LWTD = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1 && 'Date'[WeekDay]<=max('Date'[WeekDay]) ))

 

 

 

Anonymous
Not applicable

Hi @amitchandak ,

 

Thanks so much for your reply. 

 

I tried the way you mentioned too somehow it still doesnt work. Please see below. Are you able to advise what has gone wrong?

 

jimmyzyrzyr_0-1637552678057.png

 

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.