Forum Discussion
Problem with GROUP BY for Duplicates
- 8 years ago
Hi imani_tech,
Made a small CSV file with the same fields as you have:
UserDelegatePermissions
A AA AAA A AA BBB A AA BBB B BB AAA C CC AAA C CC BBB C CC CCC C CC CCC As you can see I have repeated items, then made the grouping in Query editor and the result gives the duplicate in the count rows:
Are you already getting the information from the CSV or from the SQL that you had in your previous post?
Regards,
MFelix
Hi imani_tech,
To what I can see from your SQL when you do a group by the 3 fields in your table and choose the ones that have a double count you are returning a single value for row and not the duplicated values.
To replicate this though in Power BI and return the ones that are above 1 count you need to take the group by part of your SQL and then use the Group by in Power query to return 1,2, 3... in the DataCount column.
Don't know if this is just a test of the capabilities of PBI but if your data source is already refined no need to go back and ungroup and then group it on PBI, let the SQL do that for you.
Regards,
MFelix
Thanks for the response. I'm actually supposed to complete this project within Power BI, since the data source is a .csv file. However, I imported the .csv into SQL Server just to confirm that I'm doing the right thing.
- MFelix9 years agoSuper User
If you upload the CSV file to PBI and do what you were doing you should get the correct result.
Regards,
MFelix
- imani_tech8 years agoFrequent Visitor
It should work but it isn't.
- MFelix8 years agoSuper User
Hi imani_tech,
Made a small CSV file with the same fields as you have:
UserDelegatePermissions
A AA AAA A AA BBB A AA BBB B BB AAA C CC AAA C CC BBB C CC CCC C CC CCC As you can see I have repeated items, then made the grouping in Query editor and the result gives the duplicate in the count rows:
Are you already getting the information from the CSV or from the SQL that you had in your previous post?
Regards,
MFelix