Not showing returned data on chart

*** What Grafana version and what operating system are you using?**

We are using Grafana v10.1.5 on windows server 2019.

*** What are you trying to achieve?**

I have made a dashboard with the default time interval set to the last 7 days. Then I have two graphs with custom time intervals. On one chart, I set the time interval to show the last 14 days, and on the other one, to show the last 2 years.

Even though these two chart panels have custom time intervals, by default, when the dashboard loads, they always show the default time interval set on the dashboard.

*** How are you trying to achieve it?**

I want to show data with different time intervals (energy production in RT, Daily, Monthly, Yearly), thats why, I need panels on the dashboard, with different default time intervals.

  • What happened?

Panels, with custom time intervals, should use this custom intervals and not those set on the panel globaly.

  • Can you copy/paste the configuration(s) that you are having problems with?
    {
    “annotations”: {
    “list”: [
    {
    “builtIn”: 1,
    “datasource”: {
    “type”: “grafana”,
    “uid”: “-- Grafana --”
    },
    “enable”: true,
    “hide”: true,
    “iconColor”: “rgba(0, 211, 255, 1)”,
    “name”: “Annotations & Alerts”,
    “type”: “dashboard”
    }
    ]
    },
    “editable”: true,
    “fiscalYearStartMonth”: 0,
    “graphTooltip”: 0,
    “id”: 91,
    “links”: ,
    “liveNow”: true,
    “panels”: [
    {
    “collapsed”: false,
    “gridPos”: {
    “h”: 1,
    “w”: 24,
    “x”: 0,
    “y”: 0
    },
    “id”: 2,
    “panels”: ,
    “title”: “Visualiation”,
    “type”: “row”
    },
    {
    “datasource”: {
    “type”: “mssql”,
    “uid”: “bSwDFs3nz”
    },
    “fieldConfig”: {
    “defaults”: {
    “color”: {
    “mode”: “thresholds”
    },
    “mappings”: ,
    “thresholds”: {
    “mode”: “absolute”,
    “steps”: [
    {
    “color”: “#58595b”,
    “value”: null
    },
    {
    “color”: “#009785”,
    “value”: 10
    }
    ]
    },
    “unit”: “kwatt”
    },
    “overrides”:
    },
    “gridPos”: {
    “h”: 3,
    “w”: 8,
    “x”: 0,
    “y”: 1
    },
    “id”: 6,
    “options”: {
    “colorMode”: “background_solid”,
    “graphMode”: “none”,
    “justifyMode”: “auto”,
    “orientation”: “auto”,
    “reduceOptions”: {
    “calcs”: [
    “lastNotNull”
    ],
    “fields”: “/^value$/”,
    “values”: false
    },
    “textMode”: “auto”
    },
    “pluginVersion”: “10.1.5”,
    “targets”: [
    {
    “dataset”: “ADServerInfo_msgper”,
    “datasource”: {
    “type”: “mssql”,
    “uid”: “bSwDFs3nz”
    },
    “editorMode”: “code”,
    “format”: “table”,
    “rawQuery”: true,
    “rawSql”: “SELECT\r\nDATEDIFF(second, ‘1970-01-01’, TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’) AS time,\r\n[Value] / ${power_constant} AS value,\r\n’Power’ AS metric\r\nFROM [database].[dbo].[vwLastData]\r\nWHERE $__timeFilter(TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’)\r\nAND [ps_id] = ‘${ps_id}_Power’\r\nORDER BY TagTime DESC;”,
    “refId”: “A”,
    “sql”: {
    “columns”: [
    {
    “parameters”: ,
    “type”: “function”
    }
    ],
    “groupBy”: [
    {
    “property”: {
    “type”: “string”
    },
    “type”: “groupBy”
    }
    ],
    “limit”: 50
    }
    }
    ],
    “title”: “Power”,
    “transparent”: true,
    “type”: “stat”
    },
    {
    “datasource”: {
    “type”: “mssql”,
    “uid”: “NBU_k3MSk”
    },
    “fieldConfig”: {
    “defaults”: {
    “color”: {
    “mode”: “thresholds”
    },
    “mappings”: ,
    “thresholds”: {
    “mode”: “absolute”,
    “steps”: [
    {
    “color”: “#58595b”,
    “value”: null
    },
    {
    “color”: “#009785”,
    “value”: 10
    }
    ]
    },
    “unit”: “masskg”
    },
    “overrides”:
    },
    “gridPos”: {
    “h”: 3,
    “w”: 8,
    “x”: 8,
    “y”: 1
    },
    “hideTimeOverride”: true,
    “id”: 7,
    “options”: {
    “colorMode”: “background_solid”,
    “graphMode”: “none”,
    “justifyMode”: “auto”,
    “orientation”: “auto”,
    “reduceOptions”: {
    “calcs”: [
    “lastNotNull”
    ],
    “fields”: “/^value$/”,
    “values”: false
    },
    “textMode”: “auto”
    },
    “pluginVersion”: “10.1.5”,
    “targets”: [
    {
    “dataset”: “ADServerInfo_msgper”,
    “datasource”: {
    “type”: “mssql”,
    “uid”: “NBU_k3MSk”
    },
    “editorMode”: “code”,
    “format”: “table”,
    “rawQuery”: true,
    “rawSql”: “SELECT\r\n DATEDIFF(second, ‘1970-01-01’, TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’) AS time,\r\n CO2Offset / ${energy_constant} AS value,\r\n ‘CO2Offset’ AS metric\r\nFROM [database].[dbo].[vw_CO2Offset]\r\nWHERE $__timeFilter(TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’)\r\n AND [ps_id] = ‘${ps_id}’\r\nORDER BY TagTime DESC;”,
    “refId”: “A”,
    “sql”: {
    “columns”: [
    {
    “parameters”: ,
    “type”: “function”
    }
    ],
    “groupBy”: [
    {
    “property”: {
    “type”: “string”
    },
    “type”: “groupBy”
    }
    ],
    “limit”: 50
    }
    }
    ],
    “timeFrom”: “now-1y”,
    “title”: “CO2 Offset”,
    “transparent”: true,
    “type”: “stat”
    },
    {
    “datasource”: {
    “type”: “mssql”,
    “uid”: “bSwDFs3nz”
    },
    “fieldConfig”: {
    “defaults”: {
    “color”: {
    “mode”: “thresholds”
    },
    “mappings”: ,
    “thresholds”: {
    “mode”: “absolute”,
    “steps”: [
    {
    “color”: “#58595b”,
    “value”: null
    },
    {
    “color”: “#009785”,
    “value”: 10
    }
    ]
    },
    “unit”: “megwatt”
    },
    “overrides”:
    },
    “gridPos”: {
    “h”: 3,
    “w”: 8,
    “x”: 16,
    “y”: 1
    },
    “hideTimeOverride”: true,
    “id”: 8,
    “options”: {
    “colorMode”: “background_solid”,
    “graphMode”: “none”,
    “justifyMode”: “auto”,
    “orientation”: “auto”,
    “reduceOptions”: {
    “calcs”: [
    “lastNotNull”
    ],
    “fields”: “/^value$/”,
    “values”: false
    },
    “textMode”: “auto”
    },
    “pluginVersion”: “10.1.5”,
    “targets”: [
    {
    “dataset”: “ADServerInfo_msgper”,
    “datasource”: {
    “type”: “mssql”,
    “uid”: “bSwDFs3nz”
    },
    “editorMode”: “code”,
    “format”: “table”,
    “rawQuery”: true,
    “rawSql”: “SELECT\r\n DATEDIFF(second, ‘1970-01-01’, TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’) AS time,\r\n Energy / ${energy_constant} AS value,\r\n ‘Energy’ AS metric\r\nFROM [database].[dbo].[vwArchiveYear]\r\nWHERE $__timeFilter(TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’)\r\n AND [ps_id] = ‘${ps_id}’\r\nORDER BY TagTime DESC;”,
    “refId”: “A”,
    “sql”: {
    “columns”: [
    {
    “parameters”: ,
    “type”: “function”
    }
    ],
    “groupBy”: [
    {
    “property”: {
    “type”: “string”
    },
    “type”: “groupBy”
    }
    ],
    “limit”: 50
    }
    }
    ],
    “timeFrom”: “now-1y”,
    “title”: “Total Energy produced”,
    “transparent”: true,
    “type”: “stat”
    },
    {
    “datasource”: {
    “type”: “mssql”,
    “uid”: “NBU_k3MSk”
    },
    “fieldConfig”: {
    “defaults”: {
    “color”: {
    “mode”: “thresholds”
    },
    “mappings”: ,
    “thresholds”: {
    “mode”: “absolute”,
    “steps”: [
    {
    “color”: “#58595b”,
    “value”: null
    },
    {
    “color”: “#009785”,
    “value”: 10
    }
    ]
    },
    “unit”: “kwatt”
    },
    “overrides”:
    },
    “gridPos”: {
    “h”: 10,
    “w”: 24,
    “x”: 0,
    “y”: 4
    },
    “id”: 3,
    “options”: {
    “inlineEditing”: true,
    “root”: {
    “background”: {
    “color”: {
    “fixed”: “transparent”
    },
    “image”: {
    “fixed”: “img/bg/PV Plant Schema.png”
    },
    “size”: “cover”
    },
    “border”: {
    “color”: {
    “fixed”: “dark-green”
    }
    },
    “constraint”: {
    “horizontal”: “left”,
    “vertical”: “top”
    },
    “elements”: [
    {
    “background”: {
    “color”: {
    “fixed”: “transparent”
    }
    },
    “border”: {
    “color”: {
    “fixed”: “dark-green”
    }
    },
    “config”: {
    “align”: “center”,
    “color”: {
    “fixed”: “rgba(36, 41, 46, 1)”
    },
    “size”: 35,
    “text”: {
    “fixed”: “Power”
    },
    “valign”: “middle”
    },
    “constraint”: {
    “horizontal”: “left”,
    “vertical”: “top”
    },
    “name”: “Element 1”,
    “placement”: {
    “height”: 50,
    “left”: 574,
    “top”: 218,
    “width”: 219
    },
    “type”: “text”
    },
    {
    “background”: {
    “color”: {
    “field”: “value”,
    “fixed”: “#D9D9D9
    }
    },
    “border”: {
    “color”: {
    “fixed”: “dark-green”
    }
    },
    “config”: {
    “align”: “center”,
    “color”: {
    “fixed”: “text”
    },
    “size”: 35,
    “text”: {
    “field”: “value”,
    “fixed”: “”,
    “mode”: “field”
    },
    “valign”: “middle”
    },
    “constraint”: {
    “horizontal”: “left”,
    “vertical”: “top”
    },
    “name”: “Element 2”,
    “placement”: {
    “height”: 50,
    “left”: 573,
    “top”: 263,
    “width”: 219
    },
    “type”: “metric-value”
    },
    {
    “background”: {
    “color”: {
    “fixed”: “transparent”
    }
    },
    “border”: {
    “color”: {
    “fixed”: “dark-green”
    }
    },
    “config”: {
    “align”: “center”,
    “color”: {
    “fixed”: “rgba(36, 41, 46, 1)”
    },
    “size”: 16,
    “text”: {
    “fixed”: " "
    },
    “valign”: “middle”
    },
    “connections”: [
    {
    “color”: {
    “field”: “value”,
    “fixed”: “rgba(36, 41, 46, 1)”
    },
    “path”: “straight”,
    “size”: {
    “field”: “value”,
    “fixed”: 2,
    “max”: 3,
    “min”: 1
    },
    “source”: {
    “x”: 1,
    “y”: 0
    },
    “target”: {
    “x”: -1.0129032258064516,
    “y”: -0.024793388429752067
    },
    “targetName”: “Element 4”
    }
    ],
    “constraint”: {
    “horizontal”: “left”,
    “vertical”: “top”
    },
    “name”: “Element 3”,
    “placement”: {
    “height”: 121,
    “left”: 0,
    “top”: 103,
    “width”: 212
    },
    “type”: “text”
    },
    {
    “background”: {
    “color”: {
    “fixed”: “transparent”
    }
    },
    “border”: {
    “color”: {
    “fixed”: “dark-green”
    }
    },
    “config”: {
    “align”: “center”,
    “color”: {
    “fixed”: “rgba(36, 41, 46, 1)”
    },
    “size”: 16,
    “text”: {
    “fixed”: " "
    },
    “valign”: “middle”
    },
    “constraint”: {
    “horizontal”: “left”,
    “vertical”: “top”
    },
    “name”: “Element 4”,
    “placement”: {
    “height”: 121,
    “left”: 1036,
    “top”: 105,
    “width”: 292
    },
    “type”: “text”
    }
    ],
    “name”: “Element 1718611615754”,
    “placement”: {
    “height”: 100,
    “left”: 0,
    “top”: 0,
    “width”: 100
    },
    “type”: “frame”
    },
    “showAdvancedTypes”: false
    },
    “pluginVersion”: “10.1.5”,
    “targets”: [
    {
    “dataset”: “ADServerInfo_msgper”,
    “datasource”: {
    “type”: “mssql”,
    “uid”: “NBU_k3MSk”
    },
    “editorMode”: “code”,
    “format”: “table”,
    “rawQuery”: true,
    “rawSql”: “SELECT\r\nDATEDIFF(second, ‘1970-01-01’, TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’) AS time,\r\n[Value] / ${power_constant} AS value,\r\n’Power’ AS metric\r\nFROM [database].[dbo].[vwLastData]\r\nWHERE $__timeFilter(TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’)\r\nAND [ps_id] = ‘${ps_id}_Power’\r\nORDER BY TagTime DESC;”,
    “refId”: “A”,
    “sql”: {
    “columns”: [
    {
    “parameters”: ,
    “type”: “function”
    }
    ],
    “groupBy”: [
    {
    “property”: {
    “type”: “string”
    },
    “type”: “groupBy”
    }
    ],
    “limit”: 50
    }
    }
    ],
    “transparent”: true,
    “type”: “canvas”
    },
    {
    “gridPos”: {
    “h”: 1,
    “w”: 24,
    “x”: 0,
    “y”: 14
    },
    “id”: 1,
    “title”: “Data”,
    “type”: “row”
    },
    {
    “datasource”: {
    “type”: “mssql”,
    “uid”: “NBU_k3MSk”
    },
    “fieldConfig”: {
    “defaults”: {
    “color”: {
    “mode”: “thresholds”
    },
    “custom”: {
    “axisCenteredZero”: false,
    “axisColorMode”: “text”,
    “axisLabel”: “”,
    “axisPlacement”: “auto”,
    “barAlignment”: 0,
    “drawStyle”: “line”,
    “fillOpacity”: 35,
    “gradientMode”: “opacity”,
    “hideFrom”: {
    “legend”: false,
    “tooltip”: false,
    “viz”: false
    },
    “insertNulls”: false,
    “lineInterpolation”: “smooth”,
    “lineWidth”: 3,
    “pointSize”: 5,
    “scaleDistribution”: {
    “type”: “linear”
    },
    “showPoints”: “auto”,
    “spanNulls”: true,
    “stacking”: {
    “group”: “A”,
    “mode”: “none”
    },
    “thresholdsStyle”: {
    “mode”: “off”
    }
    },
    “displayName”: “PV Power”,
    “mappings”: ,
    “thresholds”: {
    “mode”: “absolute”,
    “steps”: [
    {
    “color”: “#58595b”,
    “value”: null
    },
    {
    “color”: “#009785”,
    “value”: 80
    }
    ]
    },
    “unit”: “kwatt”
    },
    “overrides”:
    },
    “gridPos”: {
    “h”: 8,
    “w”: 24,
    “x”: 0,
    “y”: 15
    },
    “id”: 4,
    “options”: {
    “legend”: {
    “calcs”: [
    “lastNotNull”,
    “max”
    ],
    “displayMode”: “table”,
    “placement”: “bottom”,
    “showLegend”: true
    },
    “tooltip”: {
    “mode”: “single”,
    “sort”: “none”
    }
    },
    “targets”: [
    {
    “dataset”: “ADServerInfo_msgper”,
    “datasource”: {
    “type”: “mssql”,
    “uid”: “NBU_k3MSk”
    },
    “editorMode”: “code”,
    “format”: “table”,
    “rawQuery”: true,
    “rawSql”: “SELECT\r\nDATEDIFF(second, ‘1970-01-01’, TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’) AS time,\r\n[Value] / ${power_constant} AS value,\r\n’Power’ AS metric\r\nFROM [database].[dbo].[vwLastData]\r\nWHERE $__timeFilter(TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’)\r\nAND [ps_id] = ‘${ps_id}_Power’\r\nORDER BY TagTime DESC;”,
    “refId”: “A”,
    “sql”: {
    “columns”: [
    {
    “parameters”: ,
    “type”: “function”
    }
    ],
    “groupBy”: [
    {
    “property”: {
    “type”: “string”
    },
    “type”: “groupBy”
    }
    ],
    “limit”: 50
    }
    }
    ],
    “title”: “Power”,
    “transparent”: true,
    “type”: “timeseries”
    },
    {
    “datasource”: {
    “type”: “mssql”,
    “uid”: “NBU_k3MSk”
    },
    “fieldConfig”: {
    “defaults”: {
    “color”: {
    “mode”: “thresholds”
    },
    “custom”: {
    “axisCenteredZero”: false,
    “axisColorMode”: “text”,
    “axisLabel”: “”,
    “axisPlacement”: “auto”,
    “barAlignment”: 0,
    “drawStyle”: “bars”,
    “fillOpacity”: 35,
    “gradientMode”: “opacity”,
    “hideFrom”: {
    “legend”: false,
    “tooltip”: false,
    “viz”: false
    },
    “insertNulls”: false,
    “lineInterpolation”: “smooth”,
    “lineWidth”: 3,
    “pointSize”: 5,
    “scaleDistribution”: {
    “type”: “linear”
    },
    “showPoints”: “auto”,
    “spanNulls”: true,
    “stacking”: {
    “group”: “A”,
    “mode”: “none”
    },
    “thresholdsStyle”: {
    “mode”: “off”
    }
    },
    “displayName”: “PV Power”,
    “mappings”: ,
    “thresholds”: {
    “mode”: “absolute”,
    “steps”: [
    {
    “color”: “#58595b
    },
    {
    “color”: “#71c7ad”,
    “value”: 80
    }
    ]
    },
    “unit”: “kwatt”
    },
    “overrides”:
    },
    “gridPos”: {
    “h”: 8,
    “w”: 24,
    “x”: 0,
    “y”: 23
    },
    “hideTimeOverride”: true,
    “id”: 9,
    “options”: {
    “legend”: {
    “calcs”: [
    “lastNotNull”,
    “max”
    ],
    “displayMode”: “table”,
    “placement”: “bottom”,
    “showLegend”: true
    },
    “tooltip”: {
    “mode”: “single”,
    “sort”: “none”
    }
    },
    “targets”: [
    {
    “dataset”: “ADServerInfo_msgper”,
    “datasource”: {
    “type”: “mssql”,
    “uid”: “NBU_k3MSk”
    },
    “editorMode”: “code”,
    “format”: “table”,
    “rawQuery”: true,
    “rawSql”: “SELECT\r\n DATEDIFF(second, ‘1970-01-01’, TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’) AS time,\r\n Energy / ${energy_constant} AS value,\r\n ‘Energy’ AS metric\r\nFROM [database].[dbo].[vwArchiveDay]\r\nWHERE $__timeFilter(TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’)\r\n AND [ps_id] = ‘${ps_id}’\r\nORDER BY TagTime DESC;”,
    “refId”: “A”,
    “sql”: {
    “columns”: [
    {
    “parameters”: ,
    “type”: “function”
    }
    ],
    “groupBy”: [
    {
    “property”: {
    “type”: “string”
    },
    “type”: “groupBy”
    }
    ],
    “limit”: 50
    }
    }
    ],
    “timeFrom”: “now-14d”,
    “title”: “Daily production of Energy”,
    “transparent”: true,
    “type”: “timeseries”
    },
    {
    “datasource”: {
    “type”: “mssql”,
    “uid”: “NBU_k3MSk”
    },
    “description”: “”,
    “fieldConfig”: {
    “defaults”: {
    “color”: {
    “fixedColor”: “#009785”,
    “mode”: “fixed”
    },
    “custom”: {
    “axisCenteredZero”: false,
    “axisColorMode”: “text”,
    “axisLabel”: “”,
    “axisPlacement”: “auto”,
    “barAlignment”: 0,
    “drawStyle”: “bars”,
    “fillOpacity”: 35,
    “gradientMode”: “hue”,
    “hideFrom”: {
    “legend”: false,
    “tooltip”: false,
    “viz”: false
    },
    “insertNulls”: false,
    “lineInterpolation”: “smooth”,
    “lineWidth”: 3,
    “pointSize”: 5,
    “scaleDistribution”: {
    “type”: “linear”
    },
    “showPoints”: “always”,
    “spanNulls”: true,
    “stacking”: {
    “group”: “A”,
    “mode”: “none”
    },
    “thresholdsStyle”: {
    “mode”: “off”
    }
    },
    “displayName”: “Monthly energy production”,
    “mappings”: ,
    “thresholds”: {
    “mode”: “absolute”,
    “steps”: [
    {
    “color”: “#58595b
    },
    {
    “color”: “#71c7ad”,
    “value”: 80
    }
    ]
    },
    “unit”: “kwatt”
    },
    “overrides”: [
    {
    “matcher”: {
    “id”: “byFrameRefID”,
    “options”: “A”
    },
    “properties”: [
    {
    “id”: “displayName”,
    “value”: “Monthly energy production”
    },
    {
    “id”: “color”,
    “value”: {
    “fixedColor”: “#009785”,
    “mode”: “fixed”
    }
    }
    ]
    },
    {
    “matcher”: {
    “id”: “byFrameRefID”,
    “options”: “B”
    },
    “properties”: [
    {
    “id”: “displayName”,
    “value”: “Yearly energy production”
    },
    {
    “id”: “color”,
    “value”: {
    “fixedColor”: “#71c7ad”,
    “mode”: “fixed”
    }
    }
    ]
    },
    {
    “__systemRef”: “hideSeriesFrom”,
    “matcher”: {
    “id”: “byNames”,
    “options”: {
    “mode”: “exclude”,
    “names”: [
    “Monthly energy production”
    ],
    “prefix”: “All except:”,
    “readOnly”: true
    }
    },
    “properties”: [
    {
    “id”: “custom.hideFrom”,
    “value”: {
    “legend”: false,
    “tooltip”: false,
    “viz”: true
    }
    }
    ]
    }
    ]
    },
    “gridPos”: {
    “h”: 8,
    “w”: 24,
    “x”: 0,
    “y”: 31
    },
    “hideTimeOverride”: true,
    “id”: 10,
    “options”: {
    “legend”: {
    “calcs”: [
    “lastNotNull”,
    “max”,
    “min”
    ],
    “displayMode”: “table”,
    “placement”: “bottom”,
    “showLegend”: true
    },
    “tooltip”: {
    “mode”: “single”,
    “sort”: “none”
    }
    },
    “targets”: [
    {
    “dataset”: “ADServerInfo_msgper”,
    “datasource”: {
    “type”: “mssql”,
    “uid”: “NBU_k3MSk”
    },
    “editorMode”: “code”,
    “format”: “table”,
    “rawQuery”: true,
    “rawSql”: “SELECT\r\n DATEDIFF(second, ‘1970-01-01’, TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’) AS time,\r\n Energy / ${energy_constant} AS value,\r\n ‘Energy’ AS metric\r\nFROM [database].[dbo].[vwArchiveMonth]\r\nWHERE $__timeFilter(TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’)\r\n AND [ps_id] = ‘${ps_id}’\r\nORDER BY TagTime DESC;”,
    “refId”: “A”,
    “sql”: {
    “columns”: [
    {
    “parameters”: ,
    “type”: “function”
    }
    ],
    “groupBy”: [
    {
    “property”: {
    “type”: “string”
    },
    “type”: “groupBy”
    }
    ],
    “limit”: 50
    }
    },
    {
    “dataset”: “ADServerInfo_msgper”,
    “datasource”: {
    “type”: “mssql”,
    “uid”: “NBU_k3MSk”
    },
    “editorMode”: “code”,
    “format”: “table”,
    “hide”: false,
    “rawQuery”: true,
    “rawSql”: “SELECT\r\n DATEDIFF(second, ‘1970-01-01’, TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’) AS time,\r\n Energy / ${energy_constant} AS value,\r\n ‘Energy’ AS metric\r\nFROM [database].[dbo].[vwArchiveYear]\r\nWHERE $__timeFilter(TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’)\r\n AND [ps_id] = ‘${ps_id}’\r\nORDER BY TagTime DESC;”,
    “refId”: “B”,
    “sql”: {
    “columns”: [
    {
    “parameters”: ,
    “type”: “function”
    }
    ],
    “groupBy”: [
    {
    “property”: {
    “type”: “string”
    },
    “type”: “groupBy”
    }
    ],
    “limit”: 50
    }
    }
    ],
    “timeFrom”: “now-2y”,
    “title”: “Long-term energy production”,
    “transparent”: true,
    “type”: “timeseries”
    }
    ],
    “refresh”: “1m”,
    “schemaVersion”: 38,
    “style”: “dark”,
    “tags”: ,
    “templating”: {
    “list”: [
    {
    “current”: {
    “selected”: true,
    “text”: “5135132”,
    “value”: “5135132”
    },
    “hide”: 2,
    “includeAll”: false,
    “label”: “Id PV-ja”,
    “multi”: false,
    “name”: “ps_id”,
    “options”: [
    {
    “selected”: true,
    “text”: “5135132”,
    “value”: “5135132”
    },
    {
    “selected”: false,
    “text”: “5326741”,
    “value”: “5326741”
    },
    {
    “selected”: false,
    “text”: “5326737”,
    “value”: “5326737”
    },
    {
    “selected”: false,
    “text”: “5326732”,
    “value”: “5326732”
    },
    {
    “selected”: false,
    “text”: “5299514”,
    “value”: “5299514”
    },
    {
    “selected”: false,
    “text”: “5227221”,
    “value”: “5227221”
    },
    {
    “selected”: false,
    “text”: “5220901”,
    “value”: “5220901”
    },
    {
    “selected”: false,
    “text”: “5208081”,
    “value”: “5208081”
    },
    {
    “selected”: false,
    “text”: “5205847”,
    “value”: “5205847”
    },
    {
    “selected”: false,
    “text”: “5334438”,
    “value”: “5334438”
    },
    {
    “selected”: false,
    “text”: “5364535”,
    “value”: “5364535”
    },
    {
    “selected”: false,
    “text”: “5332649”,
    “value”: “5332649”
    },
    {
    “selected”: false,
    “text”: “5368482”,
    “value”: “5368482”
    },
    {
    “selected”: false,
    “text”: “5437036”,
    “value”: “5437036”
    },
    {
    “selected”: false,
    “text”: “5401501”,
    “value”: “5401501”
    },
    {
    “selected”: false,
    “text”: “5200996”,
    “value”: “5200996”
    },
    {
    “selected”: false,
    “text”: “5238029”,
    “value”: “5238029”
    },
    {
    “selected”: false,
    “text”: “5474985”,
    “value”: “5474985”
    },
    {
    “selected”: false,
    “text”: “5504153”,
    “value”: “5504153”
    }
    ],
    “query”: “5135132,\n5326741,\n5326737,\n5326732,\n5299514,\n5227221,\n5220901,\n5208081,\n5205847,\n5334438,\n5364535,\n5332649,\n5368482,\n5437036,\n5401501,\n5200996,\n5238029,\n5474985,\n5504153”,
    “queryValue”: “”,
    “skipUrlSync”: false,
    “type”: “custom”
    },
    {
    “current”: {
    “selected”: false,
    “text”: “10000”,
    “value”: “10000”
    },
    “description”: “This variable represents constants, that we need to use, to transform the data from a number to Energy, Power,… (eg. from number to kWh we need to divide the value in the database with 10,000,000).”,
    “hide”: 2,
    “includeAll”: false,
    “label”: “Power Constant”,
    “multi”: false,
    “name”: “power_constant”,
    “options”: [
    {
    “selected”: true,
    “text”: “10000”,
    “value”: “10000”
    },
    {
    “selected”: false,
    “text”: “10000000”,
    “value”: “10000000”
    }
    ],
    “query”: “10000, 10000000”,
    “queryValue”: “”,
    “skipUrlSync”: false,
    “type”: “custom”
    },
    {
    “current”: {
    “selected”: false,
    “text”: “10000”,
    “value”: “10000”
    },
    “description”: “This variable represents constants, that we need to use, to transform the data from a number to Energy, Power,… (eg. from number to kWh we need to divide the value in the database with 10,000,000).”,
    “hide”: 2,
    “includeAll”: false,
    “label”: “Energy Constant”,
    “multi”: false,
    “name”: “energy_constant”,
    “options”: [
    {
    “selected”: true,
    “text”: “10000”,
    “value”: “10000”
    },
    {
    “selected”: false,
    “text”: “10000000”,
    “value”: “10000000”
    }
    ],
    “query”: “10000, 10000000”,
    “queryValue”: “”,
    “skipUrlSync”: false,
    “type”: “custom”
    }
    ]
    },
    “time”: {
    “from”: “now-7d”,
    “to”: “now”
    },
    “timepicker”: {
    “hidden”: false
    },
    “timezone”: “utc”,
    “title”: “Panel PV”,
    “uid”: “c392cded-db92-45af-a93a-33940514cd81”,
    “version”: 58,
    “weekStart”: “”
    }

*** Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.**

No

Welcome @urosburger to the forum.

Can you share your MSSQL query, and specifically the time period being referenced?

For each panel, have you tried setting the Relative Time field to whatever you want? That will override the Time Picker. See below.

Examples for Relative Time:

Hello,

I apologize for the late reply. I have two graphs on the dashboard, with the custom time interval (independent of the time interval set on the dashboard).

The problem is, that if I set a custom interval on one of the graphs, the other one then uses this time interval, even though it has another time interval set. The time interval that these Graphs use, is the one that I set the last.

Example:
I have set on the daily graph, to show the last 14 days, and then on the monthly graph I set the time interval to show the data for the last 2 years.

Currently they will then both show, the data for the last 2 years.


This is the monthly graph, where I can see the last value in the Legend. If I click on the zoom, then it will show me the monthly data for the last 2 years.

This is the daily graph:

The query on both graphs looks like this:

SELECT
DATEDIFF(second, ‘1970-01-01’, TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’) AS time,
Energy / ${energy_constant} AS value,
‘Energy’ AS metric
FROM
WHERE $__timeFilter(TagTime AT TIME ZONE ‘Central European Standard Time’ AT TIME ZONE ‘UTC’)
AND [ps_id] = ‘${ps_id}’
ORDER BY TagTime DESC;

The only thing that is different is from which table I am pulling the data from.