March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I need to convert the following sample of Activity ID with Start Date and Finish Date and Cost / Activity
I can calculate and get Activity Duration and Cost Per Activity Per day
Then I need to convert this shape to New table with Activity ID and Date in days and Cost / activity / date
to this shape
To visualize the data as Cost and date S-Curve Primavera P6
Kindly share with me any paper related to this.
Solved! Go to Solution.
Hi @Khalil87
please try
NewTable =
SELECTCOLUMNS (
GENERATE ( 'Table', CALENDAR ( 'Table'[Start Date], 'Table'[Finsh Date] ) ),
"Activity ID", 'Table'[Activity ID],
"Date", [Date],
"Cost/Day", 'Table'[Cost/Day]
)
thank you @tamerj1 It worked perfectly
just asking for one more tip, how to consider Off-days and holidays on the calender to get zero cost on off-days, and distributr the cost on the remaining days,
Thanks in advance
@Khalil87
Please try
NewTable =
SELECTCOLUMNS (
GENERATE (
'Table',
FILTER (
CALENDAR ( 'Table'[Start Date], 'Table'[Finsh Date] ),
NOT ( WEEKDAY ( [Date], 2 ) IN { 6, 7 } )
)
),
"Activity ID", 'Table'[Activity ID],
"Date", [Date],
"Cost/Day", 'Table'[Cost/Day]
)
The calnder sheet worked fine, but the total is not correct,
I discovered that the cost/day calculated from the total duration of finish - start, without considering week ends,
so how to calculate Date Diff, of only work days?
Thank you
@Khalil87
Sorry, I got engaged with other subjects. Please create a new calculated in column in the original table.
Cost/Day Correct =
DIVIDE (
'Table'[Cost/Duration],
COUNTROWS (
FILTER (
CALENDAR ( 'Table'[Start Date], 'Table'[Finsh Date] ),
NOT ( WEEKDAY ( [Date], 2 ) IN { 6, 7 } )
)
)
)
Then the new table would be
NewTable =
SELECTCOLUMNS (
GENERATE (
'Table',
FILTER (
CALENDAR ( 'Table'[Start Date], 'Table'[Finsh Date] ),
NOT ( WEEKDAY ( [Date], 2 ) IN { 6, 7 } )
)
),
"Activity ID", 'Table'[Activity ID],
"Date", [Date],
"Cost/Day", 'Table'[Cost/Day Correct]
)
Thank you for your time,
I think it's better to recalculate the Duration in correct way first then I can get the correct cost/day
But the dates is based on calender with Friday Off, and Holidays, so could you help me how can I control the calender generation table with Friday-Off and Table of Holidays.
FILTER (
CALENDAR ( 'Table'[Start Date], 'Table'[Finsh Date] ),
WEEKDAY ( [Date], 2 ) <> 5
&& NOT ( [Date] IN VALUES ( 'Holidays'[Date] ) )
)
Hi @Khalil87
please try
NewTable =
SELECTCOLUMNS (
GENERATE ( 'Table', CALENDAR ( 'Table'[Start Date], 'Table'[Finsh Date] ) ),
"Activity ID", 'Table'[Activity ID],
"Date", [Date],
"Cost/Day", 'Table'[Cost/Day]
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
16 | |
15 | |
7 | |
6 |
User | Count |
---|---|
33 | |
29 | |
16 | |
13 | |
12 |