Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I have a table with multiple Issue_Keys, each issue_Key has multipel status records. I would like ot rank the status records based on [Created] field per Issue_Key. [Ranking expected] is what I expect:
The DAX I wrote causes a dependency circular error:
| ISSUE_KEY | FIELD | CREATED | OLD_VALUE_FORMATTED | Ranking expected |
| xxx-202 | status | 6/10/2024 3:47 | New | 1 |
| xxx-202 | status | 6/11/2024 4:46 | investigating | 2 |
| xxx-202 | status | 6/11/2024 4:56 | Waiting for customer | 3 |
| xxx-202 | status | 8/21/2024 4:44 | investigating | 4 |
| xxx-202 | status | 8/22/2024 2:56 | Waiting for customer | 5 |
| xxx-202 | status | 8/22/2024 9:06 | 6 | |
| xxx-202 | status | 8/23/2024 1:17 | Waiting for customer | 7 |
| xxx-203 | status | 6/10/2024 3:47 | New | 1 |
| xxx-203 | status | 6/11/2024 4:46 | investigating | 2 |
| xxx-203 | status | 6/11/2024 4:56 | Waiting for customer | 3 |
| xxx-203 | status | 8/21/2024 4:44 | investigating | 4 |
| xxx-203 | status | 8/22/2024 2:56 | Waiting for customer | 5 |
| xxx-203 | status | 8/22/2024 9:06 | Mediagenix investigating | 6 |
| xxx-203 | status | 8/23/2024 1:17 | Waiting for customer | 7 |
Solved! Go to Solution.
@Jeanxyz , Use below DAX
DAX
Ranking =
VAR CurrentIssueKey = 'Fact_Status Log'[ISSUE_KEY]
VAR CurrentCreated = 'Fact_Status Log'[CREATED]
RETURN
CALCULATE(
COUNTROWS(
FILTER(
'Fact_Status Log',
'Fact_Status Log'[ISSUE_KEY] = CurrentIssueKey &&
'Fact_Status Log'[CREATED] <= CurrentCreated
)
),
ALLEXCEPT('Fact_Status Log', 'Fact_Status Log'[ISSUE_KEY])
)
Proud to be a Super User! |
|
@Jeanxyz , Use below DAX
DAX
Ranking =
VAR CurrentIssueKey = 'Fact_Status Log'[ISSUE_KEY]
VAR CurrentCreated = 'Fact_Status Log'[CREATED]
RETURN
CALCULATE(
COUNTROWS(
FILTER(
'Fact_Status Log',
'Fact_Status Log'[ISSUE_KEY] = CurrentIssueKey &&
'Fact_Status Log'[CREATED] <= CurrentCreated
)
),
ALLEXCEPT('Fact_Status Log', 'Fact_Status Log'[ISSUE_KEY])
)
Proud to be a Super User! |
|
Thanks a lot, @bhanu_gautam . It works like a charm.
I slightly changed the measure, using all() instead of allexcept(), it also works.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
| User | Count |
|---|---|
| 47 | |
| 45 | |
| 33 | |
| 33 | |
| 30 |
| User | Count |
|---|---|
| 136 | |
| 116 | |
| 58 | |
| 58 | |
| 56 |