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

Display last date that an equipament was repaired in a new register

Hi Dear,

 

I´ve trying to do a code that display the last date that an equipment was repaired,but in a new event (register) that happened an new problem. 
I got to do a measures but I need to do in a column calculated, and my measure code wasn´t work in a power query.

Example my code in a measures was that below:

VAR Date = SELECTEDVALUE('Table1'[Date IN])
VAR previous = CALCULATE(MAX('Table1'[Date OUT]);FILTER(ALL('Table1'[Date IN]);Date >'Table1'[Date IN]))
return
Date
In the example above happened an error of circular when I had created a column calculated, could you help me with?
   column that I want 
serialDate INDate Outlast date out 
A01/01/202005/01/2020noneNone because no exist register before that
B01/01/202006/01/2020none
C01/01/202005/01/2020none
A10/01/202015/01/202005/01/2020 
B12/01/202018/01/202006/01/2020 
C20/01/202024/01/202005/01/2020 
A01/02/202007/03/202015/01/2020 
B02/03/202007/03/202018/01/2020 
C20/03/202025/03/202024/01/2020 
 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@leandross89 ,

Try

last date out = maxx(filter(table,table[serial]=earlier(table[serial]) && table[Date Out] <earlier(table[Date Out])),table[Date Out])

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@leandross89 ,

Try

last date out = maxx(filter(table,table[serial]=earlier(table[serial]) && table[Date Out] <earlier(table[Date Out])),table[Date Out])

thanks for your help

Greg_Deckler
Super User
Super User

Maybe : https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/td-p/985814

 

Or See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.