Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kbdw
New Member

Wind Direction Aster Plot

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.

 

kbdw_1-1686793953358.png

 

There are two main issues with this output :

 

  • I cannot sort the "order" of direction categories on the plot to match the compass layout.
  • Any direction categories without any datapoints e.g., N, NE, do not plot at all.

 

Hope someone can assist.

 

11 REPLIES 11
lbendlin
Super User
Super User

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/2023218.255102SW
19/06/2023225.3489583SW
18/06/2023204.5104167SSW
17/06/2023194.9947917SSW
16/06/2023198.8020833SSW
15/06/2023179.8125S
14/06/2023191.6041667SSW
13/06/2023197.2447917SSW
12/06/2023185.725625S
11/06/2023184.21875S
10/06/2023183.609375S
9/06/2023118.2463542ESE
8/06/202389.62833333E
7/06/2023128.9645833SE
6/06/2023168.300625SSE
5/06/2023207.6360417SSW
4/06/2023246.9727083WSW
3/06/2023286.3077083WNW
2/06/2023297.9644792WNW
1/06/2023211.5104167SSW
31/05/2023199.5104167SSW
30/05/2023228.2552083SW
29/05/2023278.5677083W
28/05/2023208.4166667SSW
27/05/2023193.6979167SSW
26/05/2023214.1041667SW
25/05/2023188.5729167S
24/05/2023190.0677083S
23/05/2023189.8020833S
22/05/2023198.7135417SSW
21/05/2023201.9947917SSW
20/05/2023229.9427083SW
19/05/2023217.9583333SW
18/05/2023209.640625SSW
17/05/2023177.4895833S
16/05/2023190.2291667S
15/05/2023189.8385417S
14/05/2023187.9895833S
13/05/2023188.953125S
12/05/2023208.9166667SSW
11/05/2023194.9791667SSW
10/05/2023204.390625SSW
9/05/2023284.578125WNW
8/05/2023260.7239583W
7/05/2023241.5729167WSW
6/05/2023318.96875NW
5/05/2023238.125WSW
4/05/2023222.0260417SW
3/05/2023272.6875W
2/05/2023300.546875WNW
1/05/2023218.6041667SW
30/04/2023186.3541667S
29/04/2023176.21875S
28/04/2023196.7760417SSW
27/04/2023184.8125S
26/04/2023175.640625S
25/04/2023173.4791667S
24/04/2023191.921875SSW
23/04/2023176.0625S
22/04/2023204.0520833SSW
21/04/2023213.0052083SSW
20/04/2023214.5104167SW
19/04/2023226.3177083SW
18/04/2023220.5260417SW
17/04/2023177.5104167S
16/04/2023190.2604167S
15/04/2023206SSW
14/04/2023177.8177083S
13/04/2023179.9635417S
12/04/2023201.4010417SSW
11/04/2023262.8854167W
10/04/2023211.82125SSW
9/04/2023220.2760417SW
8/04/2023194.7916667SSW
7/04/2023170.5364583S
6/04/2023189.1458333S
5/04/2023154.34375SSE
4/04/2023195.390625SSW
3/04/2023198.109375SSW
2/04/2023181.595S
1/04/2023257.9895833WSW
31/03/2023198.75SSW
30/03/2023220.5260417SW
29/03/2023207.7291667SSW
28/03/2023195.4427083SSW
27/03/2023229.9583333SW
26/03/2023164.5885417SSE
25/03/2023189.21875S
24/03/2023226.28125SW
23/03/2023215.75SW
22/03/2023144.5681818SE

 

The expected outcome would resemble the below, except the directions would be arranged so as to resemble a compass rose.

kbdw_2-1687219726968.png

 

 


@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.

The standard Aster plot is not entirely satisfactory.  Probable would make sense to use Deneb for this instead.

 

lbendlin_0-1687226066690.png

See attached.

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.

 

kbdw_0-1687232909470.png

 

@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).





Did I answer your question? Mark my post as a solution!

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.

 

lbendlin_0-1687315028279.png

 

 

{
  "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:

 

dmp_0-1687467705995.png

{
  "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





Did I answer your question? Mark my post as a solution!

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):

 

dmp_1-1687468085318.png

{
  "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





Did I answer your question? Mark my post as a solution!

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

ToriSugden_0-1695519735114.png

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?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.