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
aartiladdha
Employee
Employee

Summing column values based on slicer selection

I have a table with 2 fields, Plant group and capacity. When I am using plant code as a slicer, I want the capacity to sum up accordingly. See below, if I choose *787 & *245 as plant group, I would want the capacity to show up as 30000 in my visual. Capture.PNG

 

2 ACCEPTED SOLUTIONS
Nathaniel_C
Super User
Super User

Hi @aartiladdha ,

Create a measure = SUM(table[Capacity]) and drop it on a Card. Select the [Plant Group ]as Slicer.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Washivale
Resolver V
Resolver V

Hi @aartiladdha ,

 

Create measures as below to understand outcome behaviour on slicer selection

 

Measure1 = Sum(Table[Capacity])

Measure2 = Calculate(Measure1, ALL(Table[Plant Group]))

Measure3 = Calculate(Measure1, ALLSELECTED(Table[Plant Group]))

 

let me know if it helps,

 

Regards,

Washivale

 

 

View solution in original post

7 REPLIES 7
Nathaniel_C
Super User
Super User

Hi @aartiladdha ,

It works for me. PBIX 
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

plant.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Washivale
Resolver V
Resolver V

Hi @aartiladdha ,

 

Create measures as below to understand outcome behaviour on slicer selection

 

Measure1 = Sum(Table[Capacity])

Measure2 = Calculate(Measure1, ALL(Table[Plant Group]))

Measure3 = Calculate(Measure1, ALLSELECTED(Table[Plant Group]))

 

let me know if it helps,

 

Regards,

Washivale

 

 

Nathaniel_C
Super User
Super User

Hi @aartiladdha ,

Create a measure = SUM(table[Capacity]) and drop it on a Card. Select the [Plant Group ]as Slicer.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I was pulling the Plant group from another table. It looks like a relationship issue. Once I changed it from single to "Both", it showed me correct result. Working fine now but I do want to understand how does this relationship work? Any idea?

Hi @aartiladdha ,

 

Glad you were able to figure it out. for understanding how relationships work, below would be a good starting point.

 

https://docs.microsoft.com/en-us/power-bi/desktop-create-and-manage-relationships

 

Regards,

Washivale

 

 

This is giving me sum of all the plant groups i.e. 78k

HI @aartiladdha ,

 

All three Measures Resulting into 78k? Try selecting/deselectiong plant groups to check end output for all three measures.

 

Regards,

Washivale

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.