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
Hello, I have three columns (ID, Time and Status). I would like to have some calculated column which shows me for each ID index / rank until the status is "Closed" (based on time column).
ID Time Status Index
1 01/01/2023 Other 1
1 02/01/2023 Closed 1
1 03/01/2023 Other 2
1 04/01/2023 Other 2
1 05/01/2023 Other 2
1 06/01/2023 Closed 2
1 07/01/2023 Other 3
2 06/01/2023 Other 1
2 07/01/2023 Closed 1
2 08/01/2023 Other 2
2 09/01/2023 Other 2
2 10/01/2023 Closed 2
Solved! Go to Solution.
hi, @Mateusz00
try below code
RANKX(
FILTER(
'Table','Table'[id]=EARLIER('Table'[id]) &&
'Table'[time]<=EARLIER('Table'[time])&&
'Table'[status]="closed"
),
'Table'[time],,ASC,Dense
)
Hi, @Mateusz00
Based on the information you have provided, Here are my answers to your questions.
1. Create a table of your presentation.
2. Create a calculated column, enter the appropriate DAX code and filter out the Index with Status of Closed.
Column =
VAR currentID = 'Table'[ID]
VAR currentStatus = 'Table'[Status]
RETURN
IF(currentStatus = "Closed",
RANKX(
FILTER('Table', 'Table'[ID] = currentID && 'Table'[Time] <= EARLIER('Table'[Time]) && 'Table'[Status] = "Closed"),
'Table'[Time],
,
ASC,
DENSE
),
BLANK()
)
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello, thank you for your response but how can we complete each rows? (in this formula we have blanks and I must have data exactly like in my Index column from the sample).
hi, @Mateusz00
try below code
RANKX(
FILTER(
'Table','Table'[id]=EARLIER('Table'[id]) &&
'Table'[time]<=EARLIER('Table'[time])&&
'Table'[status]="closed"
),
'Table'[time],,ASC,Dense
)
Topic got to the spam folder earlier. Can somebody helps me?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 17 | |
| 8 | |
| 8 | |
| 7 |