The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi all,
I have a set of data which has projects listed with multiple dates, I would like to make a measure that returns the latest date by project.
Im not interested to do it through a table, but would like it as a measure or a column so I can use it for forther calculation.
Thanks
Krsitoffer
Solved! Go to Solution.
Hi @Kristofferaabo,
For this I would use something like this:
MAXIMUM_END_DATE = IF ( HASONEFILTER ( Table1[Project] ); CALCULATE ( MAX ( Table1[End Project] ); ALLEXCEPT ( Table1; Table1[Project] ) ); BLANK () )
This will return the maximum date for the End project column and you can use it to make different calculations:
DURATION = DATEDIFF( MIN(Table1[Start Project]);[MAXIMUM_END_DATE];DAY)
Result:
The total in the example is incorrect, don't look at it. It can be improved is just an example.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Kristofferaabo,
First of all when you use a measure this is based on context so depending on the context of your information you will get different results off course you can use several ways to them get the final result like filters.
You only need to make the following measure:
Last Date = MAX (Table[Date])
This will return the maximum date of the project if you add the project number on your visuals / graphs / ...
As Isaid this is context based so you have to use it with the correct information to get it on project level.
Can you please explain what type of adittional calculations you want to do?
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @MFelix!
Thanks for your answer I really appreciate it, the idea might work but I have not thought a bouth as I was afraid it wouldn't be able to differentiate between the various projects.
An example of What I would like is the this:
My with is to have a measure/columns that would return 2016-05-18 s a 'stop date' for each of these three project lines..
That way I would get the longest project duration by project
Hi @Kristofferaabo,
For this I would use something like this:
MAXIMUM_END_DATE = IF ( HASONEFILTER ( Table1[Project] ); CALCULATE ( MAX ( Table1[End Project] ); ALLEXCEPT ( Table1; Table1[Project] ) ); BLANK () )
This will return the maximum date for the End project column and you can use it to make different calculations:
DURATION = DATEDIFF( MIN(Table1[Start Project]);[MAXIMUM_END_DATE];DAY)
Result:
The total in the example is incorrect, don't look at it. It can be improved is just an example.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsJoin the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
122 | |
85 | |
77 | |
55 | |
48 |
User | Count |
---|---|
136 | |
128 | |
78 | |
64 | |
63 |