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
Prr2023
Regular Visitor

How to Plot Date (Month) Vs Revenue Vs Cost? Date columns must combine from 2 different Tables

Hello all, 

I have a Table "Invoice" has columns "Invoice Date" and "Revenue".

Other Table "JobCost" has columns "Date" and "Cost".

 

I want to plot a visual of "Line and Column Chart". Which have Months on x-axis (Must be from Combination of both Tables Date column) , Y-axis Revenue, Secondary Y-axis Cost.

 

I tried to combine both Date columns but its giving me an Error. When I am refrring to any one of Date column Vs other Columns, its showing wrong values. 

 

Please guide me, how to solve this problem. I tried many options since last days. Its not working. Guidelines will be really helpful. 

 

Thank you.

 

 

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Prr2023 ,


not sure if i fully get you. supposing you have an invoice table and a cost table like:

FreemanZ_2-1699940153037.png


try like:
1) add a calculated dates table like
dates = ADDCOLUMNS( CALENDAR( MIN(MIN(invoice[Date]), MIN(cost[Date])), MAX(MAX(invoice[Date]), MAX(cost[Date])) ), "YYMM", FORMAT([Date], "YY/MM") )

 

2) relate the three tables like:

FreemanZ_3-1699940219010.png


3) plot a line and column chart with dates[yymm] column, invoice[revenue] and cost[cost] like below:

FreemanZ_4-1699940243155.png


The point is to have shared dimension from a dedicated dimensional table.

View solution in original post

2 REPLIES 2
Prr2023
Regular Visitor

It works. Thank you. 

FreemanZ
Super User
Super User

hi @Prr2023 ,


not sure if i fully get you. supposing you have an invoice table and a cost table like:

FreemanZ_2-1699940153037.png


try like:
1) add a calculated dates table like
dates = ADDCOLUMNS( CALENDAR( MIN(MIN(invoice[Date]), MIN(cost[Date])), MAX(MAX(invoice[Date]), MAX(cost[Date])) ), "YYMM", FORMAT([Date], "YY/MM") )

 

2) relate the three tables like:

FreemanZ_3-1699940219010.png


3) plot a line and column chart with dates[yymm] column, invoice[revenue] and cost[cost] like below:

FreemanZ_4-1699940243155.png


The point is to have shared dimension from a dedicated dimensional table.

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!

December 2024

A Year in Review - December 2024

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