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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Trolleri
Helper I
Helper I

Filter total sales for categories that has products f

Hello,

 

I am trying to make a measure that shows the total sales for all products in all categories that have products in it from a specific manufacturer. So lets say i have a manufacturer that have products in categories 1,2,4 then i would like to have a measure that shows the sum of the total sales for all products in those 3 categories.

 

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @Trolleri ,

 

We can create a table and a both relationship to meet your requirement.

 

1. Create a summarize table.

 

Table 2 = SUMMARIZE('Table','Table'[categories],"Total",SUM('Table'[sales]))

 

filter1.jpg

 

2. Then create one to many relationship between them.

 

filter2.jpg

 

3. At last create a table visual like this,

 

filter3.jpg

 

If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data?

It will be helpful if you can show us the exact expected result based on the tables.

 

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

View solution in original post

2 REPLIES 2
v-zhenbw-msft
Community Support
Community Support

Hi @Trolleri ,

 

We can create a table and a both relationship to meet your requirement.

 

1. Create a summarize table.

 

Table 2 = SUMMARIZE('Table','Table'[categories],"Total",SUM('Table'[sales]))

 

filter1.jpg

 

2. Then create one to many relationship between them.

 

filter2.jpg

 

3. At last create a table visual like this,

 

filter3.jpg

 

If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data?

It will be helpful if you can show us the exact expected result based on the tables.

 

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

amitchandak
Super User
Super User

@Trolleri , Try a measure like

 

measure =
var _sel = countx(allselcted(product[category]),product[category])
return
sumx(filter(summarize(product,product[product], "_1" , distinctcount(product[category]) , "_1", sum(sales[sales])),[_1]=_sel),[_2])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.