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

Problem with calculated column

I created a calculated colum with the following code:
PRESSA GUESS = LASTNONBLANKVALUE(Merge3[Merge2.cp01.frman], MIN(Merge3[Merge2.cp01.frman]))
Which is not working
I would like to make it return for the same (item - on the right) the earlier value in chronogical terms when it's blank.

Any suggestion?

marcoproserpio_2-1633696629370.png


Expected output is like the present calculated column but with value 31 loaded on it.
Thank you.


 

1 ACCEPTED SOLUTION
marcoproserpio
Helper II
Helper II

Couldn't make it work within that one, solved within this one:

Column =
VAR ThisData = Merge3[Dates]
VAR DataMax = CALCULATE(MAX(Merge3[Dates]), FILTER(ALLEXCEPT(Merge3, Merge3[items.itnbr]), Merge3[Dates]<= ThisData && LEN(Merge3[Merge2.cp01.frman])>0))
RETURN
CALCULATE(MAX(Merge3[Merge2.cp01.frman]), FILTER(ALLEXCEPT(Merge3,Merge3[items.itnbr]), Merge3[Dates] = DataMax))

View solution in original post

2 REPLIES 2
marcoproserpio
Helper II
Helper II

Couldn't make it work within that one, solved within this one:

Column =
VAR ThisData = Merge3[Dates]
VAR DataMax = CALCULATE(MAX(Merge3[Dates]), FILTER(ALLEXCEPT(Merge3, Merge3[items.itnbr]), Merge3[Dates]<= ThisData && LEN(Merge3[Merge2.cp01.frman])>0))
RETURN
CALCULATE(MAX(Merge3[Merge2.cp01.frman]), FILTER(ALLEXCEPT(Merge3,Merge3[items.itnbr]), Merge3[Dates] = DataMax))
amitchandak
Super User
Super User

@marcoproserpio , Try a new column as

 


var _max= maxx(filter(Merge3, Merge3[items.nbr] =earlier(Merge3[items.nbr])),Merge3[Dates])
return
maxx(filter(Merge3, Merge3[items.nbr] =earlier(Merge3[items.nbr]) && Merge3[Dates]=_max ),Merge3[PRESSA_GUESSA])

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.