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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
LortT
Frequent Visitor

Fix duplicate data

Hello everyone. I have a bit of a duplicate data issue per below.
I create a custom visuals and uing data like this:

LortT_0-1704691156359.png


and this is my capabilities

"dataRoles": [
{
"name": "rows",
"displayName": "Rows",
"displayNameKey": "Visual_Rows",
"kind": "Grouping"
},
{
"name": "values",
"displayName": "Values",
"displayNameKey": "Visual_Values",
"kind": "Grouping"
}
],
"dataViewMappings": [
{
"table": {
"rows": {
"select": [
{
"for": {
"in": "rows"
}
},
{
"for": {
"in": "values"
}
}
]
}
}
}
],

 but my data I get when console logs has the duplicate elements in value removed when I select Brand and sales.
[
["SamSung",10],
["SamSung",11],
["SamSung",12],
["SamSung",13],
["SamSung",15],
["SamSung",16],
["SamSung",17]
]
How can i fix this. 

1 ACCEPTED SOLUTION

Hi @LortT

 

@lbendlin's answer is correct. You must include a data role in your capabilities that encourages users to add a unique identifier row to the visual dataset to make Power BI project rather than aggregate. Power BI will always aggregate to the highest possible level based on unique values in the dataset (for columns). The Violin Plot custom visual needs this, and I wrote a blog post explaining the concept with some visual aids, which should help clarify the approach you will need to take.

 

Regards,

 

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)




View solution in original post

6 REPLIES 6
lbendlin
Super User
Super User

Please provide a more detailed explanation of what you are aiming to achieve. What have you tried and where are you stuck?

Hello, I want to create a table in cusom visuals and display my information. I choose dataViewMappings as table and dataRoles with kind as row and value. My data has 9 rows and there is overlap, data sales duplicated in  10$ and 11$, When I drag brand into rows and Sales into value, the data returned to me is 7 rows instead of 9. The 2 duplicate values ​​10$ and 11$ have disappeared. I want to ask if there is any way I can get all data without removing duplicates

To prevent automatic aggregation you need to add a unique field to your visual, like a row index.

What you mean is adding a unique field to data or my visuals, is there any way to set the data return to not automatically delete duplicate values? I want when I drag brand into rows and Sales into value, the data will be displayed in full 9 rows like in excels data, is there any way?

Hi @LortT

 

@lbendlin's answer is correct. You must include a data role in your capabilities that encourages users to add a unique identifier row to the visual dataset to make Power BI project rather than aggregate. Power BI will always aggregate to the highest possible level based on unique values in the dataset (for columns). The Violin Plot custom visual needs this, and I wrote a blog post explaining the concept with some visual aids, which should help clarify the approach you will need to take.

 

Regards,

 

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)




LortT
Frequent Visitor

thank you @dm-p  and @lbendlin , it work for me

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors