Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
90 | |
87 | |
84 | |
66 | |
49 |
User | Count |
---|---|
131 | |
110 | |
96 | |
70 | |
67 |