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.
Solved! Go to Solution.
@Anonymous,
Based on your description, to achieve your requirement, you can create a calculate column using DAX below:
Task completion Days = VAR previous_approval_date = CALCULATE ( MAX ( Table1[Approval Date/time] ), FILTER ( Table1, Table1[Index] = EARLIER ( Table1[Index] ) - 1 && Table1[Requistion ID] = EARLIER ( Table1[Requistion ID] ) ) ) RETURN SWITCH ( TRUE (), Table1[Index] = 1, DATEDIFF ( Table1[Approval Date/time], Table1[Requisition Date], DAY ), Table1[Index] > 1, DATEDIFF ( Table1[Approval Date/time], previous_approval_date, DAY ) )
You can also refer to the appendix.
Regards,
Jimmy Tao
@Anonymous,
You should create a calculate column, not a measure.
Regards,
Jimmy Tao
@Anonymous,
Based on your description, to achieve your requirement, you can create a calculate column using DAX below:
Task completion Days = VAR previous_approval_date = CALCULATE ( MAX ( Table1[Approval Date/time] ), FILTER ( Table1, Table1[Index] = EARLIER ( Table1[Index] ) - 1 && Table1[Requistion ID] = EARLIER ( Table1[Requistion ID] ) ) ) RETURN SWITCH ( TRUE (), Table1[Index] = 1, DATEDIFF ( Table1[Approval Date/time], Table1[Requisition Date], DAY ), Table1[Index] > 1, DATEDIFF ( Table1[Approval Date/time], previous_approval_date, DAY ) )
You can also refer to the appendix.
Regards,
Jimmy Tao
Hello Jimmy,
Thanks for your expression . I also need to find the latest date based on Index ( i.e. Max(Index)) in Our case Index 4 is the highest index for requistion ID xyz123. I need to get the Latest Approval Date/Time( i.e. DEC 6,2018) AND SUBTRACT it with first requistion date ( Nov 15,2018) to get the number of days it took to complete the given task for a specified requistion ID . I will appreciate if you could help me getting the expression.
Thanks
@Anonymous,
You should create a calculate column, not a measure.
Regards,
Jimmy Tao
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 |
---|---|
109 | |
95 | |
77 | |
65 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |