Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi , How would I add previous transaction in the Prev_trans columm
Solved! Go to Solution.
@JunMenoza You need a variation on MTBF. 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....
The basic pattern is:
Column =
VAR __Current = [Value]
VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])
VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
__Current - __Previous
Hi:
If you can put the date in the table e.g. 4-10-2021 and add an index column using Power Query (1 -8) then this calculated column will work for you.
To put an index column in, go to transform data, "add index column (from 1). Here is an example file. I hope this solves your question!
https://drive.google.com/file/d/1NmKBreErOFNw8EqCo3yHMvItL_p7QZkE/view?usp=sharing
Hi:
If you can put the date in the table e.g. 4-10-2021 and add an index column using Power Query (1 -8) then this calculated column will work for you.
To put an index column in, go to transform data, "add index column (from 1). Here is an example file. I hope this solves your question!
https://drive.google.com/file/d/1NmKBreErOFNw8EqCo3yHMvItL_p7QZkE/view?usp=sharing
@JunMenoza You need a variation on MTBF. 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....
The basic pattern is:
Column =
VAR __Current = [Value]
VAR __PreviousDate = MAXX(FILTER('Table','Table'[Date] < EARLIER('Table'[Date])),[Date])
VAR __Previous = MAXX(FILTER('Table',[Date]=__PreviousDate),[Value])
RETURN
__Current - __Previous
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
21 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |