This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi,
I have a table and in that column, when I see 18, I need a new column to replace this value by the last value < 18. In that case, the 16 should be 16, the 18 should be 16 and the 27 should be 27. There is another column with date.
Thanks
Solved! Go to Solution.
Hi @Anonymous,
The first part gives us the last number < 18. The formula should be like below which just replaces 16 with "lastValue".
Column =
VAR lastValue =
CALCULATE ( MAX ( [idSpecies] ), Table1[idSpecies] < EARLIER ( Table1[idSpecies] ) )
RETURN
IF ( [idSpecies] = 18, lastValue, [idSpecies] )
The example in the snapshot shows the last value of 10.
Best Regards,
Dale
Hi @Anonymous,
Try this formula as a calculated column.
Column =
VAR lastValue =
CALCULATE ( MAX ( [Column1] ), Table3[Column1] < EARLIER ( Table3[Column1] ) )
RETURN
IF ( [Column1] = 18, 16, [Column1] )
Best Regards,
Dale
Hi @v-jiascu-msft,
Two things about that:
1. It works for now but sooner or later the number in that column will change, except the 18. So when I'll see the 10, I'll want the 18 become 10. The 18 should always become the last number < 18.
2. In that formula I don't understand the reason of the first part:
VAR lastValue =
CALCULATE ( MAX ( [Column1] ), Table3[Column1] < EARLIER ( Table3[Column1] ) )
RETURNThe formula IF([Column1] = 18, 16, [Colomun1]) get the same result?
Thanks
Hi @Anonymous,
The first part gives us the last number < 18. The formula should be like below which just replaces 16 with "lastValue".
Column =
VAR lastValue =
CALCULATE ( MAX ( [idSpecies] ), Table1[idSpecies] < EARLIER ( Table1[idSpecies] ) )
RETURN
IF ( [idSpecies] = 18, lastValue, [idSpecies] )
The example in the snapshot shows the last value of 10.
Best Regards,
Dale
So, what you want is the EARLIER function. See my article on Mean Time Before Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 27 | |
| 25 | |
| 25 | |
| 21 | |
| 14 |
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 20 | |
| 18 | |
| 18 |