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
airwolf39
Helper V
Helper V

Need a measure to select a Week

Hi Folks,

 

The first part of my  probelm was fixed. I can now find the date when inventory goes to 0 using this forumula:

Untitled.png

Untitled.png

 

Now i need a measure that will select the week that the "No Inv Date" falls in (in the above case it is Week 2).

 

Here is the measure that i am trying to use to make this work:

Untitled.png

 

I am trying to use the 'No Inv Date' to set the max of the Due date in the date table and then pick the last non blank of the Week column... which should be '2'. Any ideas how to modify the above measure to remove the error?

 

Thanks,

Brian

1 ACCEPTED SOLUTION

@airwolf39 

Ok, try:

week num = LOOKUPVALUE(Date Table [Week], Date Table [Date], [No inv Date])





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

7 REPLIES 7
PaulDBrown
Community Champion
Community Champion

@airwolf39 

Try:

Week number  = WEEKNUM([No inv Date])





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Great suggestion, but I failed to mention that 'week' is a calculated column. If you look at my graph, you will see that 'week' is really 'week from today'. That is why there is a week 0 (these are the dates from yesterday and before).

@airwolf39 

Ok, try:

week num = LOOKUPVALUE(Date Table [Week], Date Table [Date], [No inv Date])





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Oh my goodness, i didnt realize that I could use lookupvalue in a measure... i thought it was restricted to creating calculated columns... what a game changer! Thank you!!

airwolf39
Helper V
Helper V

Post edited with new 'Find Week" issue

lbendlin
Super User
Super User

use

 

..., if(sumx('Master Spec 5',[Ending Inv_C])=0,1,0))

lbendlin
Super User
Super User

Use CALCULATE with a value filter

 

something like CALCULATE(FIRSTDATE(dates[date]),sum(Inventory[Units])=0)

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.