Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have two tables:
AllIssues:
| key | Resolved |
| GCL-2379 | 11/04/2023 |
| GCL-2397 | 27/03/2023 |
| GSX-2137 | 27/03/2023 |
AllHistory:
| key | Status | History New Value Start |
| GCL-2379 | UP | 15/03/2023 |
| GCL-2379 | BL | 15/03/2023 |
| GCL-2379 | UP | 16/03/2023 |
| GCL-2379 | END | 11/04/2023 |
| GCL-2397 | UP | 23/03/2023 |
| GCL-2397 | LT | 24/03/2023 |
| GCL-2397 | END | 27/03/2023 |
| GSX-2137 | UP | 20/03/2023 |
| GSX-2137 | END | 27/03/2023 |
I wanna count the number of keys that was "Status" = "UP" rightbefore the date of "Resolved" (table AllIssues). It seems to be easy but i am stuck =(
For the example above, the measure output would be 2, because only GSX-2137 and GCL-2379 was "UP" right before the date of 'Resolved'.
Solved! Go to Solution.
Ok,
Finally got the question.
So the below DAX function works. Same assumption as before regarding relationships between both tables.
If both tables have a relationship based on the "key" columns then a simple measure should be sufficient:
Count_UP=
When added to a table based on AllIssues columns the rowcontext should identify each Resolved date by row. See bellow Picture.
Please mark it if it works.
Regards,
It doesn't work because I don't want all the "UP" statuses, I just want it to count when the UP status is immediately before the resolved date.
For example, for key GCL-2397, it will not increase my measure because the status right before 'resolved date' is 'LT' not 'UP'.
Hi Pedro,
This should work. Assuming again there is an active relationship between both tables based on "Key" column.
I defined the right before 'resolve date' as trailing 10 days. You can modify it as you see fit.
Hello!
"Right Before" means the last Status before "Resolved" must be "UP". It does not matter if it was 10 days ago or 1000 days ago.
The measure have to count just two lines (Distinctcount by key).
| GCL-2379 | UP | 16/03/2023 |
| GSX-2137 | UP | 20/03/2023 |
Ok,
Finally got the question.
So the below DAX function works. Same assumption as before regarding relationships between both tables.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 9 | |
| 5 | |
| 5 |