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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

PBI is grouping by NAME and not by ID

Hi guys,

I have this situation in PBI, I hope you can help.

 

I have my table visual to make sure everything looks like in the data source.
Right now, I have selected only the product "Chocolate con Almendras" (Almond chocolate ice cream).

As you can see in the table, there are 5 "Chocolate con almendras" products but this is because
the 5 of them are different products which come in different presentations (presentacion), and
have unique unit prices (PU Novo Foods) and production costs (Costo U Baccio). Therefore, in the data source,
I have given a unique ID for each of them, however, when I want to separately visualize the unit costs(PU NOVO FOODS) against the production costs (COSTO U BACCIO) (which is the dark blue line) of each of them, Power BI is grouping the product by name and not by a unique ID, and the result is that PBI is summing up all the unit prices/production costs and showing me that there's only 1 product with that name even though they have unique IDs. Here's the image:

 

SharedScreenshot.jpg

 

So, how I can sort them by ID?

 

 

Thanks all.

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

You need to create a unique product field to use as your chart axis.

The easiest way to do this is in Power Query, select your [Producto] column, then Ctrl + click your [Presentacion] column so they are both highlighted, then on the ribbon go to the Add Column tab, then select Merge. This will create a new column with unique product descriptions to be used in your visuals.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

You need to create a unique product field to use as your chart axis.

The easiest way to do this is in Power Query, select your [Producto] column, then Ctrl + click your [Presentacion] column so they are both highlighted, then on the ribbon go to the Add Column tab, then select Merge. This will create a new column with unique product descriptions to be used in your visuals.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

Thank you for your answer.

So, I will be creating a new column with no repeated names, right?

I have merged my PRODUCT column with the ID_presentation column, as the PRESENTATION value is stored in another query (cause I'm just trying to relate IDs). 

 Like in the following image:SharedScreenshot2.jpg

 

 

So, now I have the thing that the new column added an extra number to my products (as highlighted in yellow in the image above). If I remove them, would I be getting the same situation as the previous one?

 

Thanks in advance.

 

@Anonymous 

 

If you use your [PRODUCTO BUENO] field as your chart axis you will show separate totals for each type of Chocolate Ice Cream etc.

And yes, if you remove the [ID_Presentacion] numbers from this field, your chart will group all your Chocolate Ice Cream types into a single total again.

 

My recommendation for best presentation would be to merge your main table with the table that holds the presentation descriptions on [ID_presentacion], then do the column merge on [Producto] and [Presentacion]. This will give you items on your axis like:

Choc ice cream 250ml

Choc ice cream 125ml etc.

rather than:

Choc ice cream 34

Choc ice cream 17 etc. which is what you have now.

 

Hope this makes sense.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




mahoneypat
Employee
Employee

Have you tried also adding your ID_Producto column to the x-axis of your visual?  Once you do that, you can expand to next level of the hierarchy in upper right of the visual to show both the group and ID info.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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