Forum Discussion
Violin Plot (1.2.0) Plots Graph with Wrong Data
- 7 years ago
Hi Winston_Lai ,
It's hard to determine everything from your screenshot, but I'd suggest the following:
- Put the Index column in the Sampling field - this is to ensure that all rows are unique going into the visual
- Put your Month column in the Category field
- Put your Quantity column in the Measure field
If this is still causing you trouble, please feel free to share your workbook with me privately - my contact details are on the repo wiki - and I will try to set up an appropriate configuration for you to illustrate.
In terms of further resources, the wiki or the sample report on AppSource fully document the visual and its capabilities.
Best of luck,
Daniel
Hi Amy,
Referring to the screenshot: https://1drv.ms/u/s!AmY23HMj-m0In-49hOOUYGqKXmu9gw
The correct data as per loaded into Power BI is "1164, March" whereas Violin Plot takes it as "2328" for plotting, which is incorrect. I have plot exactly the same set of data for normal bar chart, it shows correctly as "1164". And there is only one record "1164" in March.
Thank You & Best Regards
Winston Lai
Hi Winston_Lai ,
Maybe there are two records for the same "1164, March" , and them are summarized automatically? You can check the truth in Data view.
Best Regards,
Amy
- Winston_Lai7 years agoNew Member
Hi Amy,
Yeah, there are two records on different dates of March with "1164". In this case, I want to produce the violin plot to show the distribution of quantity in March but I don't want the two records on different dates to be taken as one. How could I achieve it?
Thank You & Best Regards
Winston Lai
- v-xicai7 years ago
Community Support
Hi,
You can remove duplicates value if this operation won't affect other important column value.
Best Regards,
Amy
- Winston_Lai7 years agoNew Member
Hi Amy,
Thank you so much for the annotated screenshot! I understand that I can remove the duplicate data to avoid confusion. But what if I need to keep all the data and still visualize them on the violin plot? When I group the "quantity" data by month, they happen to be the same value. However, they are actually different. Since I can plot them correctly on Excel with normal box plot, is there any turnaround on violin plot for me to fix this issue?
Thank You & Best Regards
Winston Lai
- dm-p7 years ago
Super User
Hi Winston_Lai ,
The visual needs a unique value for each sampling row, so that they don't get pre-aggregated - the easiest way to do this is to create an index column in your query, or use a primary key if you have it.
I hope this helps you out, and I hope that you enjoy the visual,
Daniel
- Winston_Lai7 years agoNew Member
Hi Daniel,
For my data set, each "Date" is unique as a primary key and it is already read as date hierarchy format in Power BI. I want to produce violin plot by grouping the "Quantity" data by month. So I dragged the "Month" from the date hierarchy field to plot the graph. That is where the aggregation occurs. I tried to create the additional index column but it didn't help. I can't drag that index field to help me in this case. How should I make use of Index column?
Thank You & Best Regards
Winston Lai