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
RaedHussein
New Member

Count item names

Hey everyone

I Have a selling table that every time I sell an item it updated new row with the item name and selling price and some other columns, I want make a new table that contains 2 columns one for the item name and the other COUNT number of this item from selling table, how can I do that

1 ACCEPTED SOLUTION
_adamdosso
New Member

IN DAX, create a new table 

 

NEW_TABLE = SUMMARIZE(TABLE_NAME,
                                             ITEM_COLUMN_NAME,
                                             "UNITS_SOLD", COUNTROWS(TABLE_NAME)
                                              )
 
You can do it with Power Query too

View solution in original post

6 REPLIES 6
RaedHussein
New Member

@AlB Many thanks, this is my first time I used to ask, I won't next time >>

Yes Sure, but most of the cells is in the Arabic language except the header of columns 

this is the link
 https://www.dropbox.com/scl/fi/5mp76qw64ykninmxk3e2v/Birwaz-test-1-Copy.xlsx?dl=0&rlkey=8e9lamfhy780...

and this is a sample of what I am trying to do 

RaedHussein_0-1619126719862.png

The first visual on the left contains a number of selling the item and its revenue, the second one on the right calculates the profit depending on revenue - material cost.. it's work on the visual but not on the card, because the measure need corrections in filtering I guess so 

_adamdosso
New Member

IN DAX, create a new table 

 

NEW_TABLE = SUMMARIZE(TABLE_NAME,
                                             ITEM_COLUMN_NAME,
                                             "UNITS_SOLD", COUNTROWS(TABLE_NAME)
                                              )
 
You can do it with Power Query too

Many thanks @_adamdosso.

Can you help me more with a few questions? 

 

AlB
Super User
Super User

Hi @RaedHussein 

You can do this in PQ (Group By) or DAX (ADDCOLUMNS). Which one do you need?

Can you provide a sample of your initial table as example?

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Hi AIP, thanks for helping.

I Prefer Dax.

I hope you can help with all I need>>

let us say I have these 2 tables on an Excel file

RaedHussein_0-1619124530634.png


The first table on the right is for calculating the cost for every item depending on the kind of material

And the second table on the left is for sold items with details of the buyer.

I need to calculate the material cost of sold items for each product, in a way that I can use a filter to know the cost of each material.

So there are products costs and materials costs of sold product 





@RaedHussein 

Can you share the tables in an Excel file so that the contents can be readily copied? You can upload a file by sharing the URL to the file hosted elsewhere: Dropbox, Onedrive... or just upload the file to a site like tinyupload.com (no sign-up required).

 

Plus can you show an example of the output that you are looking for, be it in a table or in a visual?

 

Do not mark the question solved until it actually is.

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

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.

Top Solution Authors