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
Lesliekeziah
Frequent Visitor

Need help for formula (sum of many selected item in slicer)

Hi All formula experts,

 

Can you please help me. I am trying to workout the formula to calculate the sum of all items if two or more items were selected in the slicer. Please refer below to my existing formula and the visualization.

 

Result Wanted: If Selected Items are D & E, Data Will Show

D 21

E 2

F 24

G 14

and so on and so forth...

Thank you all for your help 🙂

 

formula:

=CALCULATE (SUM(Orders[Quantity2]), CALCULATETABLE(SUMMARIZE(Orders,Orders[Document Number/ID]), ALL(Orders[Item]), USERELATIONSHIP(Orders[Item],'Filter Product'[Item])))

 

Screenshot 2024-02-29 110503.png

 

DDD.png

 

4 REPLIES 4
v-yanimei-msft
Community Support
Community Support

Hi @Lesliekeziah , 

From your issue, I guess you may need the result as following steps.

Please follow these steps:

  1. Two test tables are in following  two pictures.vyanimeimsft_1-1709199295894.pngvyanimeimsft_2-1709199316623.png
  2. Right-click Table, select New Measure and input:

 

 

Measure = CALCULATE(
    SUM('Table'[num]),
    FILTER(
        'Table',
        'Table'[item2] IN VALUES('Filter Product'[Item])
    )
)
​

 


vyanimeimsft_3-1709199365653.png

 

 

  • If you select B&C, the result will be shown as the following picture.vyanimeimsft_4-1709199393538.png

Best Regards,

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

Hi

Thank you so much for your input.

 

Not sure if this will work. I have 200 products with 2k plus transactions. What if in a transaction I won't be able to put the 'dummy' item, I don't think it will capture the quantity. Thank you again

 
some_bih
Super User
Super User

Hi @Lesliekeziah 

Check your column selections and measure applied, see picture it could be reason for wrong amounts.

some_bih_0-1709189767641.png

 





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

Proud to be a Super User!






Hi there, 

the quantity is correct. what I am after is that when I select D and E in the slicer, it will some up everything for all the items (not separate ). For Instance, if I select D and E, item F will have a quantity of 24 (12 from Item D and 12 from Item E). Hopefully it makes sense. THanks

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.

Top Solution Authors