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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

SUM multiple columns based on user selection

Your help please and I am open to any ideas and solutions on how to accomplish this.

 

I have a data table with 4 columns; columns A,B & C are whole numbers and Type is text (see example below).

The client wants the ability to select any combination of columns A, B and/or C with the expected result being the sum of the selected columns.

 

EXAMPLE

Data Table  
ABCType
521Bird
362Cat

 

measures: a=
a = calculate(  sum( A ) )
b = calculate( sum( B ) )
c = calculate( sum( C ) )

 

Slicer #1Slicer #2
ABird
BCat
C 

 

Scenario #1:Scenario #2:Scenario #3:
Selected Slicer #1:  A, B, CSelected Slicer #1:  A, CSelected Slicer #1:  A
Selected Slicer #2: BirdSelected Slicer #2: BirdSelected Slicer #2: Cat
Expexted Total : 5+2+1 = 8 Expexted Total : 5+1 = 6Expexted Total : 3

 

Results Table  
scenariototalType
#18Bird
#26Bird
#33Cat

 

Thank you advance for your input, ideas and help

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

you can select the type column and unpivot other columns in PQ

11.PNG12.png

13.png

 

pls see the attachment below





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

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@Anonymous 

you can select the type column and unpivot other columns in PQ

11.PNG12.png

13.png

 

pls see the attachment below





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

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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