Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I need help in two DAX formulas that would bring a previous row value for a certain column based on a filter criteria.
The formula would be for PrevFinish = ................................... It would consider and Repeat the Finish_Downtime for the first Index column [ID], obeying the criteria that it belongs to the same MACHINE_ID.
It could also be solved if we have a formula for the Rows_Above = .................... What is the ID difference between the current row ID and the first Row above that also belongs to the same Machine_ID
|
Solved! Go to Solution.
Hi, @Anonymous
Please check the below for creating new measures.
Prev Finish Measure =
VAR rankbyfinishtime =
RANKX (
ALLEXCEPT ( 'Table', 'Table'[MACHINE_ID] ),
CALCULATE ( MAX ( 'Table'[Finish_Dowtime] ) ),
,
DESC
)
VAR prevtime =
CALCULATE (
MAX ( 'Table'[Finish_Dowtime] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[MACHINE_ID] ),
RANKX (
ALLEXCEPT ( 'Table', 'Table'[MACHINE_ID] ),
CALCULATE ( MAX ( 'Table'[Finish_Dowtime] ) ),
,
DESC
) > rankbyfinishtime
)
)
RETURN
IF ( ISFILTERED ( 'Table'[ID] ), prevtime )
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
The solution works Jihwan, but they come as a Measure - what should I change in those same DAX formulas for them to work as a new column and not a Measure?
regards,
Leonardo
Hi, @Anonymous
Please check the below.
Hi, @Anonymous
Please check the below for creating new measures.
Prev Finish Measure =
VAR rankbyfinishtime =
RANKX (
ALLEXCEPT ( 'Table', 'Table'[MACHINE_ID] ),
CALCULATE ( MAX ( 'Table'[Finish_Dowtime] ) ),
,
DESC
)
VAR prevtime =
CALCULATE (
MAX ( 'Table'[Finish_Dowtime] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[MACHINE_ID] ),
RANKX (
ALLEXCEPT ( 'Table', 'Table'[MACHINE_ID] ),
CALCULATE ( MAX ( 'Table'[Finish_Dowtime] ) ),
,
DESC
) > rankbyfinishtime
)
)
RETURN
IF ( ISFILTERED ( 'Table'[ID] ), prevtime )
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Linkedin: linkedin.com/in/jihwankim1975/
Twitter: twitter.com/Jihwan_JHKIM
The solution works Jihwan, but they come as a Measure - what should I change in those same DAX formulas for them to work as a new column and not a Measure?
regards,
Leonardo
Hi, @Anonymous
Please check the below.
Jihwan,
It worked well, most of my parameters are in Columns and formulas with Measures and Columns can always be trick.
Have a good week,
Leonardo
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 76 | |
| 52 | |
| 51 | |
| 46 |