Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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, phase B would be 1 minute, etc). I was thinking of flattening the table (see flatten table format below). Is this possible in DAX?
Current Table Format:
ID | Phase | Start | End |
1 | A | 12:00 AM | 1:00 AM |
1 | B | 1:00 AM | 1:01 AM |
1 | C | 1:01 AM | 1:02 AM |
2 | A | 12:00 AM | 1:00 AM |
2 | B | 1:00 AM | 1:01 AM |
2 | C | 1:01 AM | 1:02 AM |
Flatten Table Format:
ID | PhaseA | PhaseAStart | PhaseAEnd | PhaseB | PhaseBStart | PhaseBEnd | PhaseC | PhaseCStart | PhaseCEnd |
Solved! Go to Solution.
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.
Thank you, worked perfectly. I am not trying to calc the phase times, troulbe on this statement:
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 , a new table
Summarize(Table, Table[ID],
"Phase A Start", Minx(filter(Table, Table[Phase] ="A" ), [Start Date]),
"Phase A END", Maxx(filter(Table, Table[Phase] ="A" ), [END Date]),
"Phase B Start", Minx(filter(Table, Table[Phase] ="A" ), [Start Date]),
"Phase B END", Maxx(filter(Table, Table[Phase] ="A" ), [END Date]),
"Phase C Start", Minx(filter(Table, Table[Phase] ="A" ), [Start Date]),
"Phase C END", Maxx(filter(Table, Table[Phase] ="A" ), [END Date]))
Or use Phase on Matrix column, Only Visual solution
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
11 |
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
9 |