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.
Hey everyone,
I have the following datamodel and would like to know how to calculate the following, you can also see on the document attached where I need the columns, or if it would be easier with measures
Solved! Go to Solution.
Hi @Anonymous ,
Based on your description, you can as do some steps follows.
Real StartDate_column = MINX(FILTER(ALL('Task Manager'), 'Task Manager'[ID Project] = EARLIER('Task Manager'[ID Project])&&'Task Manager'[Task]<=EARLIER('Task Manager'[Task])), 'Task Manager'[Start Date])
Real EndDate_column = MAXX(FILTER(ALL('Task Manager'), 'Task Manager'[ID Project] = EARLIER('Task Manager'[ID Project])), 'Task Manager'[End Date])
Diff vs StartDates_measure = VALUE([Real StartDate_measure]-MAXX(FILTER(ALL('Project'),[ID Project]=SELECTEDVALUE('Task Manager'[ID Project])),[Schedule Start Date]))
Diff vs EndDates_measure = VALUE([Real EndDate_measure]-MAXX(FILTER(ALL('Project'),[ID Project]=SELECTEDVALUE('Task Manager'[ID Project])),[Schedule End Date]))
Real StartDate_measure = MINX(FILTER(ALL('Task Manager'), 'Task Manager'[ID Project] = SELECTEDVALUE('Task Manager'[ID Project])&&'Task Manager'[Task]<=MAX('Task Manager'[Task])), 'Task Manager'[Start Date])
Real EndDate_measure = MAXX(FILTER(ALL('Task Manager'), 'Task Manager'[ID Project] = SELECTEDVALUE('Task Manager'[ID Project])), 'Task Manager'[End Date])
Diff vs StartDates_measure = VALUE([Real StartDate_measure]-MAXX(FILTER(ALL('Project'),[ID Project]=SELECTEDVALUE('Task Manager'[ID Project])),[Schedule Start Date]))
Diff vs EndDates_measure = VALUE([Real EndDate_measure]-MAXX(FILTER(ALL('Project'),[ID Project]=SELECTEDVALUE('Task Manager'[ID Project])),[Schedule End Date]))
Result:
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Based on your description, you can as do some steps follows.
Real StartDate_column = MINX(FILTER(ALL('Task Manager'), 'Task Manager'[ID Project] = EARLIER('Task Manager'[ID Project])&&'Task Manager'[Task]<=EARLIER('Task Manager'[Task])), 'Task Manager'[Start Date])
Real EndDate_column = MAXX(FILTER(ALL('Task Manager'), 'Task Manager'[ID Project] = EARLIER('Task Manager'[ID Project])), 'Task Manager'[End Date])
Diff vs StartDates_measure = VALUE([Real StartDate_measure]-MAXX(FILTER(ALL('Project'),[ID Project]=SELECTEDVALUE('Task Manager'[ID Project])),[Schedule Start Date]))
Diff vs EndDates_measure = VALUE([Real EndDate_measure]-MAXX(FILTER(ALL('Project'),[ID Project]=SELECTEDVALUE('Task Manager'[ID Project])),[Schedule End Date]))
Real StartDate_measure = MINX(FILTER(ALL('Task Manager'), 'Task Manager'[ID Project] = SELECTEDVALUE('Task Manager'[ID Project])&&'Task Manager'[Task]<=MAX('Task Manager'[Task])), 'Task Manager'[Start Date])
Real EndDate_measure = MAXX(FILTER(ALL('Task Manager'), 'Task Manager'[ID Project] = SELECTEDVALUE('Task Manager'[ID Project])), 'Task Manager'[End Date])
Diff vs StartDates_measure = VALUE([Real StartDate_measure]-MAXX(FILTER(ALL('Project'),[ID Project]=SELECTEDVALUE('Task Manager'[ID Project])),[Schedule Start Date]))
Diff vs EndDates_measure = VALUE([Real EndDate_measure]-MAXX(FILTER(ALL('Project'),[ID Project]=SELECTEDVALUE('Task Manager'[ID Project])),[Schedule End Date]))
Result:
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Real StartDate = MINX(FILTER(ALL(TaskManager), TaskManager[ID Project] = EARLIER(TaskManager[ID Project])), TaskManager[Start Date])
Diff vs StartDates = TaskManager[Real StartDate] - RELATED(Projects[ScheduleStartDate])
Then end date would follow same pattern:
Real EndDate= MAXX(FILTER(ALL(TaskManager), TaskManager[ID Project] = EARLIER(TaskManager[ID Project])), TaskManager[End Date])
Diff vs EndDates = TaskManager[Real EndDate] - RELATED(Projects[ScheduleEndDate])
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hey, im trying to use this measure but it gives me an error with EARLIER function, is not letting me put any column there
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 |
---|---|
112 | |
97 | |
82 | |
67 | |
61 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |