Forum Discussion

mmvohra's avatar
mmvohra
Helper II
2 years ago

WIndrose plot in power BI

i want to create wind rose diagram/plot however i cannot find any help. I have tried aster plot/radar plot/R visual and charticulator. However i cannot make one. Please help

8 Replies

  • This is a simple radial plot, but how do I make windrose out of it? Can you please guide? The image below shown is the outcome that i desire.

    • lbendlin's avatar
      lbendlin
      Super User

      I don't think so. That image is from an old 2018 post.

  • I want to create windrose, can you please help in this regard?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi mmvohra 

     

    Thanks for the reply from lbendlin , please allow me to provide another insight:

    Power BI supports Python scripts, which can be used to create a wide range of custom visualizations, including wind rose diagrams. You'll need to have Python installed on your machine along with the necessary libraries.

    Ensure your dataset includes columns for wind direction (in degrees from 0 to 360) and wind speed. The data should be clean and ready for visualization.

     

    Add a Python visual to your report and add the necessary fields to the Values section.

    Use the following sample Python script, adjusting it to fit your dataset's column names:

    Here for your reference:

     

    import matplotlib.pyplot as plt
    from windrose import WindroseAxes
    
    # Sample data
    direction = dataset['Direction']  # Replace 'Direction' with your column name for wind direction
    speed = dataset['Speed']  # Replace 'Speed' with your column name for wind speed
    
    # Create wind rose plot
    ax = WindroseAxes.from_ax()
    ax.bar(direction, speed, normed=True, opening=0.8, edgecolor='white')
    ax.set_legend()
    
    plt.show()

     

     You can adjust the script to customize the appearance of your wind rose diagram. The library offers several options for customization, including changing the color, the number of direction bins, and more.

     

    Best Regards

    Zhengdong Xu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • mmvohra's avatar
      mmvohra
      Helper II

      Thanks for code it is working.However, there is one issue that it is not dynamic.Can you help in this regard?

    • SaaaraJ's avatar
      SaaaraJ
      New Member

      Good day,

       

      Thanks. I was able to get the windrose built in the power bi desktop but  that particually visual cannot displayed after I published the report to a workspace, with runtime error. see message detail here. can you please advice what should be done in order to let the visual display in a published report? Thanks

       

      Script Runtime Error

      [S-9263c0fe-64c3-422d-b386-7d82544a7cd8][S-9263c0fe-64c3-422d-b386-7d82544a7cd8]ModuleNotFoundError: No module named 'windrose'

      Please try again later or contact support. If you contact support, please provide these details.