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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
rdorsey
Frequent Visitor

Need help combining two date fields

I have a data set which has fields for "process name", "date started", and "date completed". I would like to create a clustered column chart with time on the X axis and for the Y axis a column showing how many processes were started and a column showing how many processes were ended. I can do this in two separate visualizations no problem, but my boss wants them in a single plot and I'm really at a loss for how to get that to work. Any advice would be greatly appreciated!

1 ACCEPTED SOLUTION
fhill
Resident Rockstar
Resident Rockstar

OK, probably lots of ways to do this, but here's one idea...  

 

1. Create a new Calendar Date Table based on the MIN Start Date and MAX Complete Date:

zDate Table = CALENDAR(MIN('zData Table'[Date Started]), MAX('zData Table'[Date Complete]))

 

** Don't join it to your original table, i'll explain why later. **

 

Create these custom columns on your NEW Date table...

Count of Start Dates = CALCULATE( COUNTA( 'zData Table'[Date Started]), FILTER('zData Table', 'zData Table'[Date Started] = 'zDate Table'[Date]))
Count of Comp Dates = CALCULATE( COUNTA( 'zData Table'[Date Complete]), FILTER('zData Table', 'zData Table'[Date Complete] = 'zDate Table'[Date]))
 
Now create your chart based on the Date Table and your 2 new columns....

fhill_0-1626379506855.png

 
If you create a Join between the two tables, you would have to choose a primary connection between either Date Started or Date Completed, and that would throw off all your numbers.
 
Hope this helps...
Forrest



Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




View solution in original post

3 REPLIES 3
fhill
Resident Rockstar
Resident Rockstar

OK, probably lots of ways to do this, but here's one idea...  

 

1. Create a new Calendar Date Table based on the MIN Start Date and MAX Complete Date:

zDate Table = CALENDAR(MIN('zData Table'[Date Started]), MAX('zData Table'[Date Complete]))

 

** Don't join it to your original table, i'll explain why later. **

 

Create these custom columns on your NEW Date table...

Count of Start Dates = CALCULATE( COUNTA( 'zData Table'[Date Started]), FILTER('zData Table', 'zData Table'[Date Started] = 'zDate Table'[Date]))
Count of Comp Dates = CALCULATE( COUNTA( 'zData Table'[Date Complete]), FILTER('zData Table', 'zData Table'[Date Complete] = 'zDate Table'[Date]))
 
Now create your chart based on the Date Table and your 2 new columns....

fhill_0-1626379506855.png

 
If you create a Join between the two tables, you would have to choose a primary connection between either Date Started or Date Completed, and that would throw off all your numbers.
 
Hope this helps...
Forrest



Did I answer your question, or help you along the way?
Please give Kudos or Mark as a Solution!


https://www.linkedin.com/in/forrest-hill-04480730/

Proud to give back to the community!
Thank You!




rdorsey
Frequent Visitor

This worked perfectly, thank you!

Greg_Deckler
Super User
Super User

@rdorsey If I am not mistaken, you are going for this:


Take a look at these two Quick Measures as I think you want something like them.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364
https://community.powerbi.com/t5/Quick-Measures-Gallery/Periodic-Billing/m-p/409365



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.