The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Good morning!
I am encountering some issues while trying to create a box plot with R.
The plot loads on the screen, i..e no problems with libraries; however, the mean and median are completely wrong.
For the far left box, the mean is supposed to be 4.3, yet, as you can see it is closer to 50.
I believe the problem lies with R determining how to calculate mean and median with the raw data. Although, it appears the dots on the box plot are correct, i.e. they correspond with the numbers in the raw data.
For clarity, the raw data contains about 200,000 rows and each row contains a number (IND_CASE_COUNT) and a category (PCTY_CD).
Any help on this would be appreciated. I ran into a similar problem with one of the downloadable visuals, as it produced a box plot but it was not producing the correct mean and median.
Thank you 🙂
I am not sure if we are allowed to bump messages. I would appreciate some help, even if it means posting this in a different forum. Thanks!
FYI boxplots do not display means! The lines in the boxplots you posted are the medians of each group and each box stretches between the 1st and 3rd quartiles of your data. So, first thing I'd suggest is checking if some medians you calculate in your data are matching up with the boxplots. If you're finding the box plots are still not lining up with your expectations, the only Power BI element I could see contributing to the issue is if you're summarizing the fields you added to the visual or something. You could also just build the plot in R (outside of PBI) and see if they are the same to confirm whether PBI is affecting the output.
Hope this helps!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
2 | |
1 | |
1 | |
1 |