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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
BI101
Regular Visitor

Overlaying two graphs

Hi,

 

I have a scenario where i have an order date and a quote date - the date includes both month and year.

I have count and total price associated with each.

I'm looking to compare data by month and filter by year. 

 

i believe the x axis can be the month and is a common denominator. I'd like to graph sales vs month and quotes vs month though.

is there a way to arrange my data and graph both sales and quotes data on one graph?

 

 

2 ACCEPTED SOLUTIONS

Piggy backing on this to give @BI101 a more usable context:

Set up 2 relationships between your Calendar table and your data table.  One relationship will need to be made inactive. 

 

These relationships should be between something like 'Calendar'[Date] and 'Yourdata'[Order Date] as well as 'Calendar'[Date] and 'Yourdata'[Quote Date].  Lets assume you make "Order Date" the active relationship

Next you'll have a measure like:

Order Count = COUNTROWS('Yourdata')
Quote Count = CALCULATE(
    [Order Count],
    USERELATIONSHIP('Calendar'[Date], 'Yourdata'[Quote Date])
)

View solution in original post

v-jianpeng-msft
Community Support
Community Support

Hi, @BI101 

Thanks @lbendlin and @RossEdwards , I have the following additions. According to your description, you can use a chart like Line chart or line and stacked column chart, as shown below:

vjianpengmsft_0-1709792155570.png

vjianpengmsft_1-1709792502878.png

Place your sales field on the Y-axis and your quotes field on the Second Y-axis. Through this type of chart, you can clearly see the comparison of sales or quotes in each month. The following is a case with the same problem as yours:

Solved: Overlaying Graphs - Microsoft Fabric Community

Solved: Overlaying Graphs or Tables - Microsoft Fabric Community

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

View solution in original post

3 REPLIES 3
v-jianpeng-msft
Community Support
Community Support

Hi, @BI101 

Thanks @lbendlin and @RossEdwards , I have the following additions. According to your description, you can use a chart like Line chart or line and stacked column chart, as shown below:

vjianpengmsft_0-1709792155570.png

vjianpengmsft_1-1709792502878.png

Place your sales field on the Y-axis and your quotes field on the Second Y-axis. Through this type of chart, you can clearly see the comparison of sales or quotes in each month. The following is a case with the same problem as yours:

Solved: Overlaying Graphs - Microsoft Fabric Community

Solved: Overlaying Graphs or Tables - Microsoft Fabric Community

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

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

lbendlin
Super User
Super User

Consider employing USERELATIONSHIP for this.

Piggy backing on this to give @BI101 a more usable context:

Set up 2 relationships between your Calendar table and your data table.  One relationship will need to be made inactive. 

 

These relationships should be between something like 'Calendar'[Date] and 'Yourdata'[Order Date] as well as 'Calendar'[Date] and 'Yourdata'[Quote Date].  Lets assume you make "Order Date" the active relationship

Next you'll have a measure like:

Order Count = COUNTROWS('Yourdata')
Quote Count = CALCULATE(
    [Order Count],
    USERELATIONSHIP('Calendar'[Date], 'Yourdata'[Quote Date])
)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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