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

Measure to sum table based on another table and slicer

Hi,

 

I have 3 tables:

 

Table 1 - Transfers Table

AndyDo_2-1712725689198.png

 

 

Table 2 - Inventory Transactions Table

AndyDo_6-1712726077230.png

 

 

 

Table 3 - Locations Table

AndyDo_4-1712725726089.png

 

I want to create a measure in Table 1. For each row, it will take the item no., and look at Table 2 - Inventory Transactions Table and sum the quantity column for that item. Essentially I want to sum the quantity i purchased of this item. But I want to sum the rows in table 2 based on a slicer. The slicer is using table 3 - locations table.

 

For example - if in the slicer i select location code = Main. The measure will look like this:

 

AndyDo_5-1712726058349.png

 

I can figure out how to do this with a calculated column, but the problem with using a calculated column is that I can't use the slicer as a locations filter.

 

Thanks!

5 REPLIES 5
Anonymous
Not applicable

Hi @AndyDo ,

First of all, many thanks to @miTutorials  for your very quick and effective replies, and I will give some additions below:

1.Create the simple table.

vjiewumsft_0-1712805038408.png

2.Create the relationships between three tables.

vjiewumsft_1-1712805062786.png

3.Create the new measure to calculate sum based on slicer.

 

Sum the item no inventory Transaction = 
CALCULATE(
    SUM('Inventory Transactions Table'[Quantity]),
    FILTER(
        'Inventory Transactions Table',
        'Inventory Transactions Table'[Item No] = SELECTEDVALUE('Transfers Table'[Item No]) &&
        'Inventory Transactions Table'[Location Code] IN VALUES('Locations Table'[Location Code])
    )
)

 

4.Drag the measure into the Transfers table visual. The result is shown below.

vjiewumsft_2-1712805093773.png

 

Best Regards,

Wisdom Wu

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

Thank you. It seems if I do that the slicer will not affect the measure calculation anymore though. 

Thanks v-jiewu-msft. That works. The problem is that if I have a location slicer, and I select a location such as EAST, then my table visual will filter the rows as well. Is it possible for this slicer to not filter the table, but only the measure thats displayed in the table? Thanks!

Anonymous
Not applicable

Hi @AndyDo ,

Based on my testing again, it is impossible to filter only the measure without filtering the table when selected the location in the slicer visual.

vjiewumsft_0-1713145359186.png

please try the following methods as workaround:

Try to use Edit interactions.

vjiewumsft_1-1713145374670.png

Then, click on this button.

vjiewumsft_2-1713145382019.png

You can also view the following document to learn more about slicer visual.

Slicers in Power BI - Power BI | Microsoft Learn

Change how visuals interact in a report - Power BI | Microsoft Learn

Add a filter to a report in Power BI - Power BI | Microsoft Learn

 

Best Regards,

Wisdom Wu

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

miTutorials
Super User
Super User

Have you tried to create relationships betweeen the tables and create a slicer ?

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.