Forum Discussion
Filter timestamp based on condition and previous value
None of your sample data says "alpha". Remember that Power Query is case sensitive.
Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
Thank you. this is a better example I think:
| CHANGE_DATE_TIME | Responsable team |
| 03/03/2025 10:22:48 | Charlie |
| 03/03/2025 10:24:40 | Charlie |
| 06/03/2025 08:56:44 | Beta |
| 06/03/2025 11:07:45 | Alpha |
| 06/03/2025 11:50:43 | Alpha |
| 06/03/2025 12:05:11 | Alpha |
| 07/03/2025 07:39:00 | Alpha |
| 07/03/2025 07:39:03 | Alpha |
| 10/03/2025 08:35:06 | Alpha |
| 10/03/2025 08:53:33 | Beta |
| 10/03/2025 14:33:30 | Beta |
| 10/03/2025 14:33:39 | Beta |
| 11/03/2025 07:42:17 | Beta |
Im looking for the first value of the Change date when the responsable team is Beta, with the condition that the previuous team is Alpha.
In this case, the expected value is "10/03/2025 08:53:33"
I have to use Directimport mode and therefore I cannot use powerquery.
Thanks in advance.
Carlos
- v-aatheeque1 year agoCommunity Support
Hi slown_surelearn
Yes, since you're using DirectQuery mode, you cannot use Power Query (M language) for transformations. However, you can achieve this in DAX within Power BI.
You can create a mesure to find the change time date to when the team changes ALPHA to BETA.First_Change_To_Beta = VAR PreviousAlphaDate = CALCULATE( MAX('Table'[CHANGE_DATE_TIME]), 'Table'[Responsable team] = "Alpha", 'Table'[CHANGE_DATE_TIME] < MINX( FILTER('Table', 'Table'[Responsable team] = "Beta"), 'Table'[CHANGE_DATE_TIME] ) ) VAR FirstBetaDate = CALCULATE( MIN('Table'[CHANGE_DATE_TIME]), 'Table'[Responsable team] = "Beta", 'Table'[CHANGE_DATE_TIME] > PreviousAlphaDate ) RETURN FirstBetaDateIf this answer helped resolve your issue, please consider marking it as the accepted answer. And if you found my response helpful, I'd appreciate it if you could give me kudos. Thank you!
- v-aatheeque1 year agoCommunity Support
We haven’t heard back from you regarding our previous response and wanted to check if your issue has been resolved.If it has, please consider clicking “Accept Answer” and “Yes” if you found the response helpful.
If you still have any questions or need further assistance, feel free to let us know — we're happy to help!Thank you!
- v-aatheeque1 year agoCommunity Support
If our response addressed by the community member for your query, please mark it as Accept Answer and click Yes if you found it helpful.
Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!