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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
mwats20
Regular Visitor

Scatter with columns from related tables with many to many relationship

Hello,

 

I am trying to do a scatter with two columns from related tables, one column as X axis and another from Y axis that is in the related table.  They are related with a many to many relationship by their date column, which I would like to use as the detail.  The X axis column will be spliced down to just one value per date, while the Y axis column will also be spliced down but will end up being a sum of values per date.  I would like to show color of the data points by year.  Sample data in the tables below and example graph below.  I have attempted calculated tables, but have not been able to get anything to work.

 

Example of Table 1 - this would be spliced down to 1 city.

Table 1  
MeasureDateCityTemp
1/1/2018Chicago35
1/17/2018Chicago40
2/25/2018Chicago25
6/5/2018Chicago80
10/5/2018Chicago70
12/25/2018Chicago40
1/2/2019Chicago30
2/23/2019Chicago5
3/5/2019Chicago45
3/17/2019Chicago47
7/31/2019Chicago90
8/6/2019Chicago95
8/12/2019Chicago93
11/15/2019Chicago40
1/5/2020Chicago20
3/5/2020Chicago30
4/10/2020Chicago45
1/1/2018Houston45
1/17/2018Houston50
2/25/2018Houston35
6/5/2018Houston90
10/5/2018Houston80
12/25/2018Houston50
1/2/2019Houston40
2/23/2019Houston15
3/5/2019Houston55
3/17/2019Houston57
7/31/2019Houston100
8/6/2019Houston105
8/12/2019Houston103
11/15/2019Houston50
1/5/2020Houston30
3/5/2020Houston40
4/10/2020Houston55

 

Example Table 2 - this would be spliced down to one company that has multiple values per date.  All those values would be summed.  (In actuality my data has more than one category that will be spliced, so there is really say Company, State, County, Customertype, etc).

Table 2  
NotedDateCompanyVolume
1/1/2018A4888.8
1/17/2018A4000
2/25/2018A6000
6/5/2018A3600
10/5/2018A3200
12/25/2018A4200
1/2/2019A5400
2/23/2019A6800
3/5/2019A3600
3/17/2019A3400
7/31/2019A4000
8/6/2019A4200
8/12/2019A4120
11/15/2019A4080
1/5/2020A6200
3/5/2020A5480
4/10/2020A3800
1/1/2018A7333.2
1/17/2018A6000
2/25/2018A9000
6/5/2018A5400
10/5/2018A4800
12/25/2018A6300
1/2/2019A8100
2/23/2019A10200
3/5/2019A5400
3/17/2019A5100
7/31/2019A6000
8/6/2019A6300
8/12/2019A6180
11/15/2019A6120
1/5/2020A9300
3/5/2020A8220
4/10/2020A5700
1/1/2018B6505.44
1/17/2018B5350
2/25/2018B7950
6/5/2018B4830
10/5/2018B4310
12/25/2018B5610
1/2/2019B7170
2/23/2019B8990
3/5/2019B4830
3/17/2019B4570
7/31/2019B5350
8/6/2019B5610
8/12/2019B5506
11/15/2019B5454
1/5/2020B8210
3/5/2020B7274
4/10/2020B5090
1/1/2018B9683.16
1/17/2018B7950
2/25/2018B11850
6/5/2018B7170
10/5/2018B6390
12/25/2018B8340
1/2/2019B10680
2/23/2019B13410
3/5/2019B7170
3/17/2019B6780
7/31/2019B7950
8/6/2019B8340
8/12/2019B8184
11/15/2019B8106
1/5/2020B12240
3/5/2020B10836
4/10/2020B7560

 

The data that I want to graph (temp against volume with date as the detail and year as the color in the legend) would be this:

 

DateYearTempVolume
1/1/201820183512222
1/17/201820184010000
2/25/201820182515000
6/5/20182018809000
10/5/20182018708000
12/25/201820184010500
1/2/201920193013500
2/23/20192019517000
3/5/20192019459000
3/17/20192019478500
7/31/201920199010000
8/6/201920199510500
8/12/201920199310300
11/15/201920194010200
1/5/202020202015500
3/5/202020203013700
4/10/20202020459500

 

Thank you for your help!

Megan

 
 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mwats20 , create a common date table. Join that with both the table. You can have year , month day there.

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@mwats20 , create a common date table. Join that with both the table. You can have year , month day there.

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

This did exactly what I needed it to do, thank you so much!

mwats20
Regular Visitor

mwats20_0-1595947200619.png

Here is a pic of the graph I'm trying to create, which I couldnt get into my original post.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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