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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
malikara46
Frequent Visitor

Get amount based on data in 3 different columns

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 NameMilestone 1  Milestone 2  Milestone 3
ABC05.10.2020  
YXZ04.04.201904.12.202013.11.2021
GHL05.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      1YXZ

 

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. 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Please try to unpivot  these Milestone columns.

Vlianlmsft_0-1637647176858.png

 

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])

Vlianlmsft_1-1637647212799.png

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               
        )

Vlianlmsft_3-1637647302393.png

 

 

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Please try to unpivot  these Milestone columns.

Vlianlmsft_0-1637647176858.png

 

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])

Vlianlmsft_1-1637647212799.png

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               
        )

Vlianlmsft_3-1637647302393.png

 

 

HotChilli
Super User
Super User

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. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors