Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors