Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I am trying to create an aster plot (or similar) showing wind direction at a weather station. The measurements were every 15 minutes, from which I have created an average daily measurement. I have then created a column converting the measurement (presented in degrees) into a direction i.e. N, E, NW, SSW etc. Therefore I want to present a plot of showing the number of averaged days within each category of wind speed direction. Below shows my output so far.
There are two main issues with this output :
Hope someone can assist.
both issues can be mitigated. Easiest is to have a static dimension table with all desired directions in the right order (add an index column if needed and "sort a column by another column"). Then choose the direction from that table and say "show items with no data".
Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
Thank you for your response. I'm a beginner to Power BI so please let me know if any further information is needed.
Below is a sample dataset showing the daily averaged wind direction in degrees, converted to a direction.
Dt.1CountDirection
| 20/06/2023 | 218.255102 | SW |
| 19/06/2023 | 225.3489583 | SW |
| 18/06/2023 | 204.5104167 | SSW |
| 17/06/2023 | 194.9947917 | SSW |
| 16/06/2023 | 198.8020833 | SSW |
| 15/06/2023 | 179.8125 | S |
| 14/06/2023 | 191.6041667 | SSW |
| 13/06/2023 | 197.2447917 | SSW |
| 12/06/2023 | 185.725625 | S |
| 11/06/2023 | 184.21875 | S |
| 10/06/2023 | 183.609375 | S |
| 9/06/2023 | 118.2463542 | ESE |
| 8/06/2023 | 89.62833333 | E |
| 7/06/2023 | 128.9645833 | SE |
| 6/06/2023 | 168.300625 | SSE |
| 5/06/2023 | 207.6360417 | SSW |
| 4/06/2023 | 246.9727083 | WSW |
| 3/06/2023 | 286.3077083 | WNW |
| 2/06/2023 | 297.9644792 | WNW |
| 1/06/2023 | 211.5104167 | SSW |
| 31/05/2023 | 199.5104167 | SSW |
| 30/05/2023 | 228.2552083 | SW |
| 29/05/2023 | 278.5677083 | W |
| 28/05/2023 | 208.4166667 | SSW |
| 27/05/2023 | 193.6979167 | SSW |
| 26/05/2023 | 214.1041667 | SW |
| 25/05/2023 | 188.5729167 | S |
| 24/05/2023 | 190.0677083 | S |
| 23/05/2023 | 189.8020833 | S |
| 22/05/2023 | 198.7135417 | SSW |
| 21/05/2023 | 201.9947917 | SSW |
| 20/05/2023 | 229.9427083 | SW |
| 19/05/2023 | 217.9583333 | SW |
| 18/05/2023 | 209.640625 | SSW |
| 17/05/2023 | 177.4895833 | S |
| 16/05/2023 | 190.2291667 | S |
| 15/05/2023 | 189.8385417 | S |
| 14/05/2023 | 187.9895833 | S |
| 13/05/2023 | 188.953125 | S |
| 12/05/2023 | 208.9166667 | SSW |
| 11/05/2023 | 194.9791667 | SSW |
| 10/05/2023 | 204.390625 | SSW |
| 9/05/2023 | 284.578125 | WNW |
| 8/05/2023 | 260.7239583 | W |
| 7/05/2023 | 241.5729167 | WSW |
| 6/05/2023 | 318.96875 | NW |
| 5/05/2023 | 238.125 | WSW |
| 4/05/2023 | 222.0260417 | SW |
| 3/05/2023 | 272.6875 | W |
| 2/05/2023 | 300.546875 | WNW |
| 1/05/2023 | 218.6041667 | SW |
| 30/04/2023 | 186.3541667 | S |
| 29/04/2023 | 176.21875 | S |
| 28/04/2023 | 196.7760417 | SSW |
| 27/04/2023 | 184.8125 | S |
| 26/04/2023 | 175.640625 | S |
| 25/04/2023 | 173.4791667 | S |
| 24/04/2023 | 191.921875 | SSW |
| 23/04/2023 | 176.0625 | S |
| 22/04/2023 | 204.0520833 | SSW |
| 21/04/2023 | 213.0052083 | SSW |
| 20/04/2023 | 214.5104167 | SW |
| 19/04/2023 | 226.3177083 | SW |
| 18/04/2023 | 220.5260417 | SW |
| 17/04/2023 | 177.5104167 | S |
| 16/04/2023 | 190.2604167 | S |
| 15/04/2023 | 206 | SSW |
| 14/04/2023 | 177.8177083 | S |
| 13/04/2023 | 179.9635417 | S |
| 12/04/2023 | 201.4010417 | SSW |
| 11/04/2023 | 262.8854167 | W |
| 10/04/2023 | 211.82125 | SSW |
| 9/04/2023 | 220.2760417 | SW |
| 8/04/2023 | 194.7916667 | SSW |
| 7/04/2023 | 170.5364583 | S |
| 6/04/2023 | 189.1458333 | S |
| 5/04/2023 | 154.34375 | SSE |
| 4/04/2023 | 195.390625 | SSW |
| 3/04/2023 | 198.109375 | SSW |
| 2/04/2023 | 181.595 | S |
| 1/04/2023 | 257.9895833 | WSW |
| 31/03/2023 | 198.75 | SSW |
| 30/03/2023 | 220.5260417 | SW |
| 29/03/2023 | 207.7291667 | SSW |
| 28/03/2023 | 195.4427083 | SSW |
| 27/03/2023 | 229.9583333 | SW |
| 26/03/2023 | 164.5885417 | SSE |
| 25/03/2023 | 189.21875 | S |
| 24/03/2023 | 226.28125 | SW |
| 23/03/2023 | 215.75 | SW |
| 22/03/2023 | 144.5681818 | SE |
The expected outcome would resemble the below, except the directions would be arranged so as to resemble a compass rose.
@lbendlin wrote:Easiest is to have a static dimension table with all desired directions in the right order (add an index column if needed and "sort a column by another column"). Then choose the direction from that table and say "show items with no data".
Understand this in principle but would be grateful for directions as to how to achieve this.
Happy to use alternative plot.
The categories on that plot still need shifting so that "N" is at the north point of the diagram, and so forth. In addition - can the position of the category boundaries be altered within the circle? At the moment for example, "N" would "start" at 0 degrees whereas in fact (with my direction categories defined as they are) it would need to span 348.75 - 11.25 degrees - as below.
@dm-p can you please help me over the hump? I found theta but don't know how to draw partial arcs.
Hi @lbendlin - you also have theta2 (end angle) available for encoding. Here's the doc link (with interactive example).
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hmm. Can't seem to get it to turn the right way, even with the theta adjustments. Also tried to add placeholders for the missing directions.
{
"data": {"name": "dataset"},
"layer": [
{
"mark": {
"type": "arc",
"innerRadius": 20,
"stroke": "#444"
}
},
{
"mark": {
"type": "text",
"radiusOffset": 50
},
"encoding": {
"text": {
"field": "Direction",
"type": "nominal"
}
}
}
],
"encoding": {
"theta": {
"field": "Theta",
"type": "quantitative",
"stack": false
},
"theta2": {
"field": "Theta2",
"type": "quantitative",
"stack": false
},
"radius": {
"field": "Sum of Count",
"scale": {
"type": "sqrt",
"zero": true
}
},
"color": {
"field": "Direction",
"type": "nominal",
"legend": true
}
}
}
Hi @lbendlin,
If you want to explicitly bind the theta (and theta2) values to the radian representation from the data, you will need to use the value definition in the encoding (which maps the explicit value). If you bind a field, Vega-Lite will work out the angle based on the range of values from minimum to maximum (although you could probably manually set the range and domain on the scale to match the radian value, if you specifically wanted to still use the field definition).
Not sure if this is exactly what you're after but may get you closer:
{
"data": {"name": "dataset"},
"layer": [
{
"mark": {
"type": "arc",
"innerRadius": 20,
"stroke": "#444"
}
},
{
"mark": {
"type": "text",
"radiusOffset": 50
},
"encoding": {
"text": {
"field": "Direction",
"type": "nominal"
}
}
}
],
"encoding": {
"theta": {
"value": {"expr": "datum['Theta']"},
"type": "quantitative",
"stack": false
},
"theta2": {
"value": {"expr": "datum['Theta2']"},
"type": "quantitative"
},
"radius": {
"field": "Sum of Count",
"scale": {
"type": "sqrt",
"zero": true
}
},
"color": {
"field": "Direction",
"type": "nominal"
}
}
}
Cheers,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Updated version with a ThetaMid column (which is just the angle value in radians for the text mark):
{
"data": {"name": "dataset"},
"layer": [
{
"mark": {
"type": "arc",
"innerRadius": 20,
"stroke": "#444"
}
},
{
"mark": {
"type": "text",
"radiusOffset": 50
},
"encoding": {
"text": {
"field": "Direction",
"type": "nominal"
},
"theta": {
"value": {
"expr": "datum['ThetaMid']"
}
}
}
}
],
"encoding": {
"theta": {
"value": {
"expr": "datum['Theta']"
},
"type": "quantitative",
"stack": false
},
"theta2": {
"value": {
"expr": "datum['Theta2']"
},
"type": "quantitative"
},
"radius": {
"field": "Sum of Count",
"scale": {
"type": "sqrt",
"zero": true
}
},
"color": {
"field": "Direction",
"type": "nominal"
}
}
}
Cheers,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi Daniel,
I have been trying to extend this. I would like to colour code by wind speed (which then gives me labels for each one) and have the directions equidistant from the centre. I have created two charts one on top of the other. But wonder if there is a way to do it in one visual. I would also like the colours to be in wind speed order
Thank you for the insights. Need to bottle this up somehow. You're not planning to write a book or something on the finer details of data binding by any chance?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 86 | |
| 85 | |
| 68 | |
| 64 |