Forum Discussion

TimeStampz101's avatar
TimeStampz101
New Member
3 years ago

Count Timestamps in Multiple Date Columns and plot by month

 

Hello,

 

I have the following dataset which comprises timestamps for 3 key project milestones:

 

Dataset:

 

Project

[Text]

Department

[Text]

Start Timestamp [Date]

Review Timestamp

[Date]

Complete Timestamp

[Date]

Project 1EngineeringMarch 1, 2023March 15, 2023April 2, 2023
Project 2EngineeringMarch 2, 2023April 2, 2023April 5, 2023
Project 3Supply ChainApril 15, 2023April 20, 2023April 21, 2023
Project 4QualityMay 16, 2023  

 

I would like to manipulate this dataset in PowerBI in order to count the number of projects in each month that achieved a particular milestone.  The following table is the desired output for the sample dataset above:

 

Desired Output to create clustered column graph:

 

MonthCount StartCount ReviewCount Complete

February

Engineering

Supply Chain

Quality

0

0

0

0

0

0

0

0

0

0

0

0

March

Engineering

Supply Chain

Quality

2

2

0

0

1

1

0

0

0

0

0

0

April

Engineering

Supply Chain

Quality

1

0

1

0

2

0

1

1

3

2

1

0

May

Engineering

Supply Chain

Quality

1

0

0

1

0

0

0

0

0

0

0

0

...   

 

In PowerBI I created a calendar table and set relationships to the Start (active), Review, and Complete timestamps. As I can only have 1 active relationship, I had to create measures for Review and Complete with USERELATIONSHIP( ).

 

Review Count by Start Date = CALCULATE [Review Count] USERELATIONSHIP ( Table'[Start Timestamp] 'Calendar Table'[Date] ) )

 

Unfortunately this is not working for me and I am getting the following output:

 

MonthCount StartCount ReviewCount Complete

[Blank]

Engineering

Supply Chain

Quality

0

0

0

0

3

1

1

1

3

2

1

0

February

Engineering

Supply Chain

Quality

0

0

0

0

0

0

0

0

0

0

0

0

March

Engineering

Supply Chain

Quality

2

2

0

0

0

0

0

0

0

0

0

0

April

Engineering

Supply Chain

Quality

1

0

1

0

0

0

0

0

0

0

0

0

May

Engineering

Supply Chain

Quality

1

0

0

1

0

0

0

0

0

0

0

0

...   

 

As you can see, only the Start Timestamps are being properly displayed. Review and Complete are not - they are showing up under [blank] month.

 

I would appreciate any advice or guidance in how to approach this problem. Thank you!

2 Replies