Forum Discussion

derekma19's avatar
derekma19
Frequent Visitor
3 years ago
Solved

Line Chart with two lines with different values and dates using a unique X axis

Hi, I'm trying to display 2 lines of values based on different dates. The data is as shown as below.   StartDate EndDate StartValue EndValue 01 Jan 2021 15 Jan 2021 5 6 01 May 2021 ...
  • v-easonf-msft's avatar
    3 years ago

    Hi, derekma19 

    If you have a calendar table, you can try add another inactive relationship between ‘Table’[EndDate] and 'Calendar'[Date].

     

    Then put 'Calendar'[Date]  to the x-axis of line chart , and put the following two measure to the y-axis of line chart.

    M_startvalue = SUM('Table'[StartValue])
    M_EndValue = CALCULATE(SUM('Table'[EndValue]),USERELATIONSHIP('Table'[EndDate],'Calendar'[Date]))

     

    USERELATIONSHIP 

    Please check attached pbix for more details.

    Best Regards,
    Community Support Team _ Eason