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
selected_
Helper IV
Helper IV

How to calculate sum of a category ?

I have a column which look like this:

 

Category
new order
old order
cancelled order
pending

cancelled order

new order

new order

pending

new order

pending

 

What I want is that I want to make a measure total of each one in that category column.  

 

For example new order = 120

pending = 200

 

 

1 ACCEPTED SOLUTION

Hi @selected_ ,

 

Please create a measure like this.

Measure = COUNT(Sheet5[Category])

v-lionel-msft_0-1600656322027.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@selected_ , A measure like

Sumx(Table, Switch( True() , [Category] = "new order" ,120 , [Category]="pending ",200,0))

 

 

@amitchandak 

 

I don't have the values of each one in that category that's why I wanna calucate a measure count on how many "new order" or "pending" are in that category.

@selected_ ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

@amitchandak

The column in my dataset look like this, new order and pending with more than one records

Category
new order
new order
new order
new order
new order
new order
pending order
pending order
pending order

What I for output it gonna count amount new order and pending in each column order in to a new table like this

CategoryTotal
new order6
pending order3

Hi @selected_ ,

 

Please create a measure like this.

Measure = COUNT(Sheet5[Category])

v-lionel-msft_0-1600656322027.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

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.