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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
AnnieV
Frequent Visitor

two line chart overlay x-axis

I have two line charts I'd like to overlay - both use the same measure calculation for a score, but one is anchored on the "event date" for the year-month buckets, and the second is anchored on the "report date" for the year-month buckets. It is not atypical for an event to have a report date in a later month than the event occured. 

 

Accordingly, the model has two date dimension tables (EventDateDim and ReportDateDim) with the DateKey from EventDateDim related to the EventDateKey on the EventFact, and the DateKey from ReportDateDim related to the ReportDateKey on the EventFact. 

 

Creating individual line charts, the YearMonth buckets are drawn from the respective date dim tables, but I'd like to show both lines together instead of separated as so

Screenshot 2024-12-18 163957.png

4 REPLIES 4
Anonymous
Not applicable

Hi, @AnnieV 

Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!

 

Best Regards

Yongkang Hua.

AnnieV
Frequent Visitor

Hi @DataInsights , 

I've used userelationship in the past, but I'm not making the connection between doing that and being able to have the second line, which uses the same measure as the first? 

@AnnieV,

 

Try creating two measures, each with the same logic except one of the measures contains USERELATIONSHIP. This would allow the X-axis to slice each measure using the appropriate date field (event date or report date).





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




DataInsights
Super User
Super User

@AnnieV,

 

I would eliminate one of the date tables so your model has only one date table. Then create two relationships between the date table and EventFact; one of the relationships will be active and one will be inactive. Use the DAX function USERELATIONSHIP to invoke the inactive relationship.

 

https://dax.guide/userelationship/ 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors