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

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

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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors