Forum Discussion
Calculated Column required or would a Measure work?
Hi,
I am very close to solving an issue but need some help to get it over the line where I need an extra calculated column that shows me an Adjusted Length of 23 days = (44 - 21) = 23 days
The numbers are calculated as follows:
- 44 days = working days between Actual Start 08/03/2022 - Closed Date 09/05/2022
- Time in Deferral AP 3 = working days between 08/03/2022 (actualstart) - 10/03/2022 (actualend)
- Pseudo Days 3 = working days between 04/03/2022 (Case Received) - 08/03/2022 (actual start)
The figures are correct but I need to create a calculated column in my table that shows the Total Deferral length of this ticket as 44 days only not 88 days when I add this to a visual.
An added problem is that my table doesn't always contain multiple lines per ticket no, so, when its all on one line it's correct, the problem is when I have 2,3,4 lines per ticket.
Any help would be much appreciated!
6 Replies
- ArchStantonPower Participant
Furthermore, I have a column in my table called Rank which which Ranks each ticket 1,2,3,4,5 (1 if there's only monthly one ticket and so on) according to the the ActualStart date =
Rank Actual Start
5 03/06/2020
4 06/04/2020
3 30/03/2020
2 19/02/2020
1 17/02/2020
- AnonymousNot applicable
Hi ArchStanton ,
Here are the steps you can follow:
1. Create calculated table.
Table 2 = CALENDAR( DATE(2022,1,1),DATE(2022,12,31 ))Create calculated column. Column = WEEKDAY('Table 2'[Date],2)2. Create measure.
Total Deferral Length = var _mindate= MINX(FILTER(ALL('Table'),'Table'[Ticket No]=MAX('Table'[Ticket No])),[actualstart]) var _maxdate= MaxX(FILTER(ALL('Table'),'Table'[Ticket No]=MAX('Table'[Ticket No])),[Closed Date]) return CALCULATE( COUNT('Table 2'[Column]),FILTER(ALL('Table 2'), 'Table 2'[Date]>_mindate&&'Table 2'[Date]<=_maxdate&&NOT( 'Table 2'[Column] ) in {6,7}))Time in Deferrral Ap = CALCULATE( COUNT('Table 2'[Column]),FILTER(ALL('Table 2'), 'Table 2'[Date]>=MAX('Table'[actualstart])&&'Table 2'[Date]<=MAX('Table'[actualend])&&NOT( 'Table 2'[Column] ) in {6,7}))Time in Deferrral Ap_Measure = var _table1= SUMMARIZE('Table','Table'[actualstart],"value",[Time in Deferrral Ap]) return IF( HASONEVALUE('Table'[actualstart]), [Time in Deferrral Ap],SUMX(_table1,[value]))Adjusted Length = [Total Deferral Length] - [Time in Deferrral Ap_Measure]3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- ArchStantonPower Participant
Thank you for sending me this, much appreciated
I tried to create the first measure (Total Deferral Length) but got this error:
- AnonymousNot applicable
Hi ArchStanton ,
In The Measure Total Deferral Length, there is a field in Text format that you can modify to Date.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- ArchStantonPower Participant
Yes, that worked, thanks!
This is almost working perfectly but there are just a couple of tweaks needed.
I have my own Date table that uses Working Day = TRUE. I would like to change your references of Weekday column to this instead:
COUNT('Date Dimension' [Is Working Day] = TRUE
Also, in the example provided, the Time in Referral AP Measure of 3 days is the Working Days between the Case Received date (04/03/2022) and actualstart (08/03/2022) = 3 days on the 1st Row
(It just so happens that the Difference between actualstart & actualend is also 3 days, a coincidence)!
and then on the 2nd row its the working days between the actualstart on Row 2 10/03/2022 and actualend on Row 2 11/04/2022 = 18 days
- ArchStantonPower Participant
I have asked a separate question about possibly substituting your date table column with my IS WORKING DAY column - hope thats okj? I will accept yours as a solution as well once I've tested it against a few different ticket numbers...