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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
seanFTS
Regular Visitor

Multiple dates within same record on visual

Newbie alert; I've only just started to use PBI so will happily be pointed at tutorials etc. that I haven't yet found.

 

I have a single data source that has timestamp (dd/mm/yyy hh:mm:ss) fields that store when certain actions are taken e..g. [TSStart], [TSTriage], [TSDocument], [TSEnd],. I've grouped each of these by month so have [TSStart (bins)] etc. Each record has a unique ID [Reference].

 

What I would like to do in the first instance is show on the same visual, say a line and column chart, a count of [Reference] for how many processes started in a month as the column and how many ended in that same month as the line.

 

TIA

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, change the data type to Date.  Create a Calendar Table and then create an active relationship (Many to One and Single) from the TSStart date column of the Data Table to the Date column of the Calendar Table.  Create another relationship [Inactive] (Many to One and Single) from the TSEnd date column of the Data Table to the Date column of the Calendar Table.  Create calculated column formulas for extracting Year, Month name and Month number.  Sort the Month name column by the Month number.  To your visual, drag Year and Month name column from the Calendar Table.  Write these measures:

ID_start = distinctcount(Data[TSStart])

ID_end = calculate([ID_start],userelationship(Data[TSEnd],Calendar[Date]))

Hope this helps. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, change the data type to Date.  Create a Calendar Table and then create an active relationship (Many to One and Single) from the TSStart date column of the Data Table to the Date column of the Calendar Table.  Create another relationship [Inactive] (Many to One and Single) from the TSEnd date column of the Data Table to the Date column of the Calendar Table.  Create calculated column formulas for extracting Year, Month name and Month number.  Sort the Month name column by the Month number.  To your visual, drag Year and Month name column from the Calendar Table.  Write these measures:

ID_start = distinctcount(Data[TSStart])

ID_end = calculate([ID_start],userelationship(Data[TSEnd],Calendar[Date]))

Hope this helps. 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

I'll bear this in mind next time

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.