March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello everyone,
we have a project table where for each project we save the date of a milestone that has been passed. Milestone 1 must be passed first, than milestone 2 and than milestone 3. If a project passed all 3 milestones, all 3 columns will contain a date (see Project YXZ below)
Project Name | Milestone 1 | Milestone 2 | Milestone 3 |
ABC | 05.10.2020 | ||
YXZ | 04.04.2019 | 04.12.2020 | 13.11.2021 |
GHL | 05.10.2020 | ||
REW |
For each milestone we want to show the amount of projects that passed this milestone and the project name(s).
So the desired results looks like this:
Milestone | Number of Projects | Project Names |
Milestone 1 | 2 | ABC GHL |
Milestone 2 | 0 | |
Milestone 3 | 1 | YXZ |
The challenge where I am struggling is that we want distinct counts. So each project should be counted and displayed only once. If for example a project has reached all three milestones, it should not be counted in each milestone, but only in Milestone 3.
This rule always applies so a different scenario is when a project has reached milestone 2, it should not be displayed or counted in milestone 1 but only in milestone 2.
If a project has not passed any milestones it should not be counted or displayed on the table.
Really appreciating any help or hint.
Solved! Go to Solution.
Please try to unpivot these Milestone columns.
Create a new column to determine the last milestone experienced by the project.
End_of_Milestone =
var max_date = CALCULATE(MAX('Table (2)'[Date]),ALLEXCEPT('Table (2)','Table (2)'[Project Name]))
return IF('Table (2)'[Date]=max_date,'Table (2)'[Milestone])
Finally, create two measures to get the results you expect:
NUmber_P = COUNT('Table (2)'[End_of_Milestone])+0
Measure 2 = CONCATENATEX (
FILTER('Table (2)',NOT(ISBLANK('Table (2)'[End_of_Milestone]))),
'Table (2)'[Project Name],
", ",
'Table (2)'[Project Name],
ASC
)
Please try to unpivot these Milestone columns.
Create a new column to determine the last milestone experienced by the project.
End_of_Milestone =
var max_date = CALCULATE(MAX('Table (2)'[Date]),ALLEXCEPT('Table (2)','Table (2)'[Project Name]))
return IF('Table (2)'[Date]=max_date,'Table (2)'[Milestone])
Finally, create two measures to get the results you expect:
NUmber_P = COUNT('Table (2)'[End_of_Milestone])+0
Measure 2 = CONCATENATEX (
FILTER('Table (2)',NOT(ISBLANK('Table (2)'[End_of_Milestone]))),
'Table (2)'[Project Name],
", ",
'Table (2)'[Project Name],
ASC
)
If you stick with the original table format, you could add a column which checks each column for blank (depending on the status hierarchy e.g.:
IF (NOT ISBLANK(TablePOrig[Milestone 3]), "Milestone3",....then milestone2 and so on
---
You could also Unpivot the data and add a marker column to indicate the latest status.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
70 | |
68 |