Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello all,
i have a Table1:
Product | Date1 | Date2 | Date3 | Date4 | Date5 |
A | 01/01/2018 | 01/04/2018 | 28/06/2018 | 20/08/2018 | 28/08/2018 |
B | 02/01/2018 | 24/03/2018 | 06/05/2018 | 31/05/2018 | 28/06/2018 |
C | 03/01/2018 | 20/01/2018 | 21/01/2018 | 25/02/2018 | 22/04/2018 |
D | 04/01/2018 | 27/03/2018 | 27/03/2018 | 29/03/2018 | 22/06/2018 |
E | 05/01/2018 | 08/04/2018 | 16/06/2018 | 08/07/2018 | 07/08/2018 |
F | 06/01/2018 | 13/04/2018 | 16/05/2018 | 12/08/2018 | 18/09/2018 |
I have created a Gantt chart:
As you already know, It requires a Start date and Duration=DATEDIFF(Date Start, Date End) in the Duration field.
In my formula the Start Date is always "Date1" column while the End date must be dynamic (so depending on the selection i want the user to decide if the End Date is Date2, Date3, Date4 or Date5). How can i dynamically calculate this duration with a fixed Start Date (Date 1 column) and dynamic End Date column ? so Duration=DATEDIFF( Date1, DateX)
Thank you all in advance
Solved! Go to Solution.
hi, @Giavo
After my research, you could try this way:
Step1:
In Edit Queries, Select Date2, Date3, Date4, Date5 then click Transform->Unpivot Columns
Step2:
Close&Apply
Then you could use Value as End date or use Date1 and Value to get Duration Duration=DATEDIFF(Date1, Value, DAY)
and drag Attribute field into slicer.
Result:
Best Regards,
Lin
hi, @Giavo
After my research, you could try this way:
Step1:
In Edit Queries, Select Date2, Date3, Date4, Date5 then click Transform->Unpivot Columns
Step2:
Close&Apply
Then you could use Value as End date or use Date1 and Value to get Duration Duration=DATEDIFF(Date1, Value, DAY)
and drag Attribute field into slicer.
Result:
Best Regards,
Lin
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |