Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Scatter Plot having two dates

Hello everyone, I would like to have a scatter plot that displays the difference of number of rows (measure) between data source time and update time. I would like to have data source tim...
  • v-menakakota's avatar
    1 year ago

    Hi Anonymous ,

    Thank you for reaching out to us on the Microsoft Fabric Community Forum.



    To achieve a scatter plot in Power BI that compares two different datetime fields—source_time and update_time—on the X and Y axes respectively, a direct approach isn't possible since Power BI doesn't support datetime fields on both axes in scatter charts. As a workaround, you can create two calculated columns that convert each datetime field into a numeric format (Unix-style timestamps) using the DATEDIFF function.

    Add new column:

    source_time_numeric = DATEDIFF(DATE(2025,1,1), 'TimeData'[source_time], SECOND)

    Add new column :

    update_time_numeric = DATEDIFF(DATE(2025,1,1), 'TimeData'[update_time], SECOND)

    duration minutes:

    duration_minutes = DATEDIFF('TimeData'[source_time], 'TimeData'[update_time], MINUTE)
    In Power BI Desktop, insert a Scatter chart visual.

    • Set the fields like this:
      X Axis → source_time_numeric.
      Y Axis → update_time_numeric.
      Tooltips → add source_time, update_time, duration_minutes.

      Please go through the pbix file.

      If this post was helpful, please give us Kudos and consider marking Accept as solution to assist other members in finding it more easily.