cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FrankWoody
Helper I
Helper I

measure calculated challenge

Good night community!!!
I'm developing some measures to analyze some tasks, so:

1st Tasks have unique Value.ID but there may be different Duedate so I created a measure to bring Duedate Max.

 

MAX(Add1[value.dueDateTime])

 

2nd When there is more than one Duedate in the database, it means that the deadline has been changed, so I created a measure to count how many times they were changed.


Maximum of Last =
MAXX(

KEEPFILTERS(VALUES('Add1'[value.id])),
CALCULATE(DISTINCTCOUNT('Add1'[value.dueDateTime]))
)

DuedatechangesDuedatechanges

But my challenge is to find which activities are overdue. for that I created a calculated column that works in the column context, Now I have to convert to measure to analyze in the context of the table of the image above:

Column =
VAR C = IF(Add1[value.dueDateTime]> TODAY() && Add1[value.completedDateTime] = 0,"In progress",IF(Add1[value.completedDateTime]> 0, "Completed" ,"Overdue"))
return C


Could you help me, please ? @tamerj1 @johnt75 

1 ACCEPTED SOLUTION
vapid128
Solution Specialist
Solution Specialist

double check your [value.dueDateTime] and [duedate].

Are those 2 colnum date or datetime?

 

If they are, try use [duedate] replace [value.dueDateTime]

View solution in original post

4 REPLIES 4
vapid128
Solution Specialist
Solution Specialist

try ADD MAX() at colnum

Column =
VAR C = IF(MAX(Add1[value.dueDateTime])> TODAY() && MAX(Add1[value.completedDateTime]) = 0,"In progress",IF(MAX(Add1[value.completedDateTime])> 0, "Completed" ,"Overdue"))
return C

Thank you for your attention,
but I already tried that and it ends up checking all the tasks with Status "IN progress " being that those tasks delayed as you can see.
duadateschanges V2.png
I have to assemble the calculated measure in such a way that it maintains the context of the filter that is already in the table, I think that the problem would be that I don't know how to convert a calculated column into a calculated measure and keep the filters that are already in place in it without changing the context

vapid128
Solution Specialist
Solution Specialist

double check your [value.dueDateTime] and [duedate].

Are those 2 colnum date or datetime?

 

If they are, try use [duedate] replace [value.dueDateTime]

Now it's work 

Progress =
VAR A = MAX(Append1[value.completedDateTime])
VAR C = IF(
[Date_Deadline]> TODAY() && A = 0,"In progress",
IF(A> 0, "Done", "Overdue"))
return C

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Dev Camp Session 26

New Date - Check it Out!

Mark your calendars and join us on Thursday, October 6 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors