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.
Power BI
Power BI Desktop: How can I combine 2 Tables with 2 date columns in one Graph with a common timeline (x-axis)?
Solved! Go to Solution.
hi, @Boudewijn
After my test, you could do these follow my steps as below:
Assume that this is my data model
Step1:
Create a date table and create a Year Month Number column for each data table
Year Month Number = YEAR ( 'Date'[Date] ) * 100 + MONTH ( 'Date'[Date] )
Step2:
then create a measure
Measure = var maxdate=MAX('Date'[Year Month Number]) return CALCULATE(SUM('LEFT'[Sales]),FILTER('LEFT',maxdate='LEFT'[Year Month Number]))+CALCULATE(SUM('RIGHT'[Sales]),FILTER('RIGHT',maxdate='RIGHT'[Year Month Number]) )
Step3:
Drag the date field form date table and the measure into chart visual
here is pbix file, please try it.
https://www.dropbox.com/s/ny6bnkqp92skvdq/undefined.pbix?dl=0
Best Regards,
Lin
hi, @Boudewijn
After my test, you could do these follow my steps as below:
Assume that this is my data model
Step1:
Create a date table and create a Year Month Number column for each data table
Year Month Number = YEAR ( 'Date'[Date] ) * 100 + MONTH ( 'Date'[Date] )
Step2:
then create a measure
Measure = var maxdate=MAX('Date'[Year Month Number]) return CALCULATE(SUM('LEFT'[Sales]),FILTER('LEFT',maxdate='LEFT'[Year Month Number]))+CALCULATE(SUM('RIGHT'[Sales]),FILTER('RIGHT',maxdate='RIGHT'[Year Month Number]) )
Step3:
Drag the date field form date table and the measure into chart visual
here is pbix file, please try it.
https://www.dropbox.com/s/ny6bnkqp92skvdq/undefined.pbix?dl=0
Best Regards,
Lin
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |