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
Shloka_Lakhani
Frequent Visitor

Create comparison chart using two Date Slicer in single Line Chart

Compare two custom date slicers into a single visual for line chart. 

 

Also tried as below steps:

1) Created two Date slicer for Comparision Date and Custom Date.

2) Overlapped two line charts in the below screenshot.
3) Gave interaction to the respected line charts. So while selecting Dates from Comparison Date slicer only the Red line chart will be synchronised. And same way while selecting Dates from Date Slicer only the Blue line chart will be synchronised.

Shloka_Lakhani_2-1671536898741.png

 

Now, we want to show tooltip for the both lines at same point on hover.

 

2 REPLIES 2
Shloka_Lakhani
Frequent Visitor

 Hi @v-rzhou-msft, 

Thanks for quick response.  

  

We want to achieve below in Power BI  

Dark Blue Line : Represents Nov Month Data  

Light Blue Line : Represents Oct Month Data  

  

Range we can compare : Pre. Month  

Pre Year  

Pre Quarter 

Last 7 Days  and custom date 

 

Shloka_Lakhani_0-1671631727966.png

 

Solution you have provided is giving continue line for both the period instead of overlapping lines for both periods we are trying to compare. Please find the chart below based on your solution. 

 

 

Shloka_Lakhani_1-1671631727976.png

 

 

If you can help us with the solution where we can compare the two custom periods on a line chart. 

Please find attached sample data set below: 

Shloka_Lakhani_2-1671631727978.png

 

 

v-rzhou-msft
Community Support
Community Support

Hi @Shloka_Lakhani ,

 

Power BI only support us to show tooltips from one visual. As far as I know, you don't need to overlap two line charts to achieve your goal. Here Iauggest you to calculate two lined by measures and create two unrelated date tables for slicer.

Line 1 =
VAR _SelectDate =
    VALUES ( 'Date'[Date] )
RETURN
    CALCULATE (
        SUM ( 'TableName'[Value] ),
        FILTER ( 'TableName', 'TableName'[Date] IN _SelectDate )
    )
Line 2 =
VAR _SelectDate =
    VALUES ( 'Comparison Date'[Date] )
RETURN
    CALCULATE (
        SUM ( 'TableName'[Value] ),
        FILTER ( 'TableName', 'TableName'[Date] IN _SelectDate )
    )

Add these measures into Y axis and then you can see tooltips at the same time.

 

Best Regards,
Rico Zhou

 

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

 

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.