Forum Discussion
hartlbb
4 years agoNew Member
Flatten Table with Dax
Hi there, I have a table (current below), which has a common ID with phases associated with it. I am trying to display the time between phase (e.g. for ID 1 Phase A would be 1 hour of time, phas...
- 4 years ago
Hi, hartlbb
Please check the following methods.
Table2 = Summarize('Table', 'Table'[ID], "Phase A Start", Minx(filter('Table', 'Table'[Phase] ="A" ), [Start]), "Phase A END", Maxx(filter('Table', 'Table'[Phase] ="A" ), [End]), "Phase B Start", Minx(filter('Table', 'Table'[Phase] ="B" ), [Start]), "Phase B END", Maxx(filter('Table', 'Table'[Phase] ="B" ), [End]), "Phase C Start", Minx(filter('Table', 'Table'[Phase] ="C" ), [Start]), "Phase C END", Maxx(filter('Table', 'Table'[Phase] ="C" ), [End]), "AvailabilityDuration",DATEDIFF(Minx(FILTER('Table',[Phase]="A"),[Start]),Minx(FILTER('Table',[Phase]="B"),[Start]),SECOND))Is this the result you expect? If not, please provide more details.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
hartlbb
4 years agoNew Member
Thank you, worked perfectly. I am not trying to calc the phase times, troulbe on this statement:
"AvailabilityDuration" = DATEDIFF(Minx(FILTER('Logs_Perf','Logs_Perf'[phaseName]="Availability"),'Logs_Perf'[startTime]),Minx(FILTER('Logs_Perf','Logs_Perf'[phaseName]="Ingestion"),'Logs_Perf'[startTime]),SECOND))
- v-zhangti4 years ago
Community Support
Hi, hartlbb
Please check the following methods.
Table2 = Summarize('Table', 'Table'[ID], "Phase A Start", Minx(filter('Table', 'Table'[Phase] ="A" ), [Start]), "Phase A END", Maxx(filter('Table', 'Table'[Phase] ="A" ), [End]), "Phase B Start", Minx(filter('Table', 'Table'[Phase] ="B" ), [Start]), "Phase B END", Maxx(filter('Table', 'Table'[Phase] ="B" ), [End]), "Phase C Start", Minx(filter('Table', 'Table'[Phase] ="C" ), [Start]), "Phase C END", Maxx(filter('Table', 'Table'[Phase] ="C" ), [End]), "AvailabilityDuration",DATEDIFF(Minx(FILTER('Table',[Phase]="A"),[Start]),Minx(FILTER('Table',[Phase]="B"),[Start]),SECOND))Is this the result you expect? If not, please provide more details.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.