Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I need to calculate previous and next value (type REIS) by category and type. Please, could you help with this issue
Example:
Category | Type | Number | Date | Previous_REIS_number | Next_REIS_number |
12B | RYT | 45B | 2023-05-09 07:11 | 65T | |
12B | REIS | 65T | 2023-05-09 07:11 | ||
12B | PAS | 56T | 2023-05-09 07:56 | 65T | 78K |
12B | PAS | 35G | 2023-05-09 08:24 | 65T | 78K |
12B | REIS | 56C | 2023-05-09 08:42 | 65T | 78K |
12B | PAS | 43V | 2023-05-09 11:45 | 65T | 78K |
12B | REIS | 78K | 2023-05-09 13:04 | ||
12B | PAS | 52B | 2023-05-09 13:04 | 78K | 23S |
12B | PAS | 56H | 2023-05-09 13:05 | 78K | 23S |
12B | PAS | 45P | 2023-05-09 16:42 | 78K | 23S |
12B | KUR | 89L | 2023-05-09 19:52 | 78K | 23S |
12B | REIS | 23S | 2023-05-09 20:03 | ||
12F | PAS | 56H | 2023-05-09 07:56 | 89L | |
12F | PAS | 45P | 2023-05-09 08:24 | 89L | |
12F | REIS | 89L | 2023-05-09 08:42 | ||
12F | PAB | 23S | 2023-05-09 16:42 | 89L | 65W |
12F | REIS | 65W | 2023-05-09 13:05 | ||
12F | PAS | 56H | 2023-05-09 13:05 | 65W | |
12F | PAS | 45P | 2023-05-09 16:42 | 65W | |
12F | KUR | 89L | 2023-05-09 20:03 | 65W |
@KristinaSp 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
I saw that your article, this formulas does not work for my case. It does not consider category and type
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
68 | |
60 | |
51 | |
36 | |
36 |
User | Count |
---|---|
83 | |
72 | |
58 | |
45 | |
44 |