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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Plotting multiple dates per item in a scatter plot

The idea is that I would like to have a timeline or start/end dates on one axis and items on another, where each item has multiple dates to plot (i.e. initial release date, actual release date, release date in X country, etc.). I've tried using both Power Bi Scatterplot and Dot Plot by MAQ Software and I've only been able to plot one date per item. Please let me know if there is a way to do this or if there are any tricks I can use to simulate or get close to this solution. 

 

Thank you in advance for your help.

2 ACCEPTED SOLUTIONS

It seems like the best way to handle this is going to be to unpivot your data. Transforming it from 1 row per project to multiple rows per project will allow you to plot this the way you want.  I went from this:

ProjectInitial ReleaseActual ReleaseRelease in USRelease in EU
ABC1/1/20192/1/20193/1/20194/1/2019
DEF1/1/20191/1/20191/15/20193/15/2019
GHI1/31/2019 3/2/20192/2/2019

 

To this:

ProjectRelease TypeDate
ABCInitial Release1/1/2019
ABCActual Release2/1/2019
ABCRelease in US3/1/2019
ABCRelease in EU4/1/2019
DEFInitial Release1/1/2019
DEFActual Release1/1/2019
DEFRelease in US1/15/2019
DEFRelease in EU3/15/2019
GHIInitial Release1/31/2019
GHIRelease in US3/2/2019
GHIRelease in EU2/2/2019

 

This puts all dates in the same column, while still associating them with a release type and project.

 

I ended up using the Dot Plot by MAQ Software, since it gives slightly more control over the fields and allows you to jitter the plot points, so that you don't accidentally hide data. The first thing I did was create a numerical project ID, since all the scatter plots don't like categorical Y axes.  

ProjectID = RANKX(ALLSELECTED('Project Releases (2)'), 'Project Releases (2)'[Project], SELECTEDVALUE('Project Releases (2)'[Project]), ASC, Dense)

The actual ID doesn't matter, just the fact that each project gets a unique numerical number.  

 

From there, I played around with the various options until I got a scatter plot that looks vaguely like the one you described:

snipa.PNG

 

Honestly, at the end of the day, this is not a particularly elegant solution.  The dates are categorical, you can't color by Project name, there's no easy way to see what the project name is without hovering over a point, among others.  The current available scatter plot options just do not play well with data that isn't straight numerical info with a single category.  

 

You're more likely to be able to find success by using one of the calendar or timeline visualizations out there instead of trying to force a scatterplot to do this work for you. Good luck

View solution in original post

A mapping table would likely work.

 

As far as actually using categorical data as an axis, there might be some way with the MAQ dot plot to swap the axes, but it still doesn't treat dates as continuous as far as I can tell.

 

The other option is to develop your own dot plot visual, but that may be a little bit too much effort for this.

View solution in original post

6 REPLIES 6
vanessafvg
Super User
Super User

@Anonymous  you will need to set up a date table and then create relationships to this date table for each of your dates, one will be the primary relationship and you can create that measure easily, but then you have to use your inactive relationship to create the rest, these will be denoted in your relationships by a dotted line.  For those measures you will need to create a use relationship measure.

 

ie. 

primary relationship


CALCULATE ( sum(measuredvalue));

inactive relationships;
CALCULATE ( sum(measuredvalue); USERELATIONSHIP ( inactivedatename; 'Date'[Date] ) )

 more information here

https://www.sqlbi.com/articles/userelationship-in-calculated-columns/

 

and feel free to ask me questions.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Anonymous
Not applicable

@vanessafvg Thank you for your help! Unfortunately, I'm looking to plot multiple dates per item, not perform any calculations with a measure column. Here is an example of what I'm trying to simulate:sample.pngWould I still use something similar to your previous solution?

 

It seems like the best way to handle this is going to be to unpivot your data. Transforming it from 1 row per project to multiple rows per project will allow you to plot this the way you want.  I went from this:

ProjectInitial ReleaseActual ReleaseRelease in USRelease in EU
ABC1/1/20192/1/20193/1/20194/1/2019
DEF1/1/20191/1/20191/15/20193/15/2019
GHI1/31/2019 3/2/20192/2/2019

 

To this:

ProjectRelease TypeDate
ABCInitial Release1/1/2019
ABCActual Release2/1/2019
ABCRelease in US3/1/2019
ABCRelease in EU4/1/2019
DEFInitial Release1/1/2019
DEFActual Release1/1/2019
DEFRelease in US1/15/2019
DEFRelease in EU3/15/2019
GHIInitial Release1/31/2019
GHIRelease in US3/2/2019
GHIRelease in EU2/2/2019

 

This puts all dates in the same column, while still associating them with a release type and project.

 

I ended up using the Dot Plot by MAQ Software, since it gives slightly more control over the fields and allows you to jitter the plot points, so that you don't accidentally hide data. The first thing I did was create a numerical project ID, since all the scatter plots don't like categorical Y axes.  

ProjectID = RANKX(ALLSELECTED('Project Releases (2)'), 'Project Releases (2)'[Project], SELECTEDVALUE('Project Releases (2)'[Project]), ASC, Dense)

The actual ID doesn't matter, just the fact that each project gets a unique numerical number.  

 

From there, I played around with the various options until I got a scatter plot that looks vaguely like the one you described:

snipa.PNG

 

Honestly, at the end of the day, this is not a particularly elegant solution.  The dates are categorical, you can't color by Project name, there's no easy way to see what the project name is without hovering over a point, among others.  The current available scatter plot options just do not play well with data that isn't straight numerical info with a single category.  

 

You're more likely to be able to find success by using one of the calendar or timeline visualizations out there instead of trying to force a scatterplot to do this work for you. Good luck

Anonymous
Not applicable

@Cmcmahan This is great, thank you so much! I agree that using a calendar/timeline is much easier and I do have those visuals already on my dashboard, but I was hoping to find different ways to visualize the data. Is there any possibility of a work around to get non-numerical data (the Project name) displayed on either of the axes?

 

The only other alternative I can think of is to display a mapping table (projectID to Project name) or to just hover over a point to read the Project name.

A mapping table would likely work.

 

As far as actually using categorical data as an axis, there might be some way with the MAQ dot plot to swap the axes, but it still doesn't treat dates as continuous as far as I can tell.

 

The other option is to develop your own dot plot visual, but that may be a little bit too much effort for this.

Anonymous
Not applicable

@Cmcmahan Thanks for the help!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.