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
jereaallikko
Helper III
Helper III

Line chart showing values from two different tables

Hi,

 

I am trying to create a simple line chart showing data from two different tables.

 

Both tables contains several parameters, such as date, ID, person etc. There are over 1000 records, so I will just try to demonstrate.

The end result should look like this:

Chartwith2lines.JPG

 

 

 

Ideally I would like to maintain the date hierarchy and change it between Y-Q-M-D, so that it applies to both lines.

Do I have to create some kind of DAX measure(s) and establish relationships between the tables to make it work properly?

Any tips?

1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @jereaallikko 

 

You need to have a Calendar/date table and add connect your tables to that date table. use date table dates as axis data and the value of your table as the value of the line chart.

if you want to create a date table see this link:

https://www.vahiddm.com/post/creating-calendar-table-with-3-steps

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

 

Appreciate your Kudos!!

 

View solution in original post

4 REPLIES 4
jereaallikko
Helper III
Helper III

Hi @VahidDM @PaulDBrown @amitchandak,

 

Thanks for your replies, all of them were helpful. I got the problem solved by creating the date table with instructions by @VahidDM. Then I connected the date columns from both tables to date table. Needed to make sure that each column was the type of "date" and not f.ex "date/time".

 

Thanks everyone.

 

BR,

Jere

VahidDM
Super User
Super User

Hi @jereaallikko 

 

You need to have a Calendar/date table and add connect your tables to that date table. use date table dates as axis data and the value of your table as the value of the line chart.

if you want to create a date table see this link:

https://www.vahiddm.com/post/creating-calendar-table-with-3-steps

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

 

Appreciate your Kudos!!

 

PaulDBrown
Community Champion
Community Champion

You need to create dimension tables with unique values covering the range of values for each field common to both tables, including a Date Table. You then create one-to-many relationships (single direction) from the dimension tables to the corresponing fields in the fact tables, and use these dimension table fields in visuals, filters, slicers and measures. In your example, you use fields from the Date Table as the x-axis and measures for the calculations for the values





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

@jereaallikko , You should create a date table and join it with date.

 

And there you can have a column

Custom = format([date], "YYYY \QQ MMM DD" )

 

Sort this on the date column 

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.