Forum Discussion
Filter sum by another table
- 6 years ago
hi ARob198
Do you mean that you do a filter in visual level filter and then use the measure result in another Measure?
If so, you need to add the same filter into that visual too, the measure result in based on it row context and filter context.
otherwise, you could define it in the measure like this
Measure =CALCULATE( SUM('Table 1'[Value]),'Table 2'[Type]="Cash")But this will not interaction by slicer.
Regards,
Lin
hi ARob198
You could try this way as below:
Step1:
Create a relationship between two tables by Name
https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-create-and-manage-relationships
Step2:
Then just create a simple meausre
Measure = SUM('Table 1'[Value])
Step3:
Now drag type into a slicer to filter data as below:
here is sample pbix file, please try it.
Regards,
Lin
- ARob1986 years ago
Helper IV
Hello v-lili6-msft, I apologzie but this isn't what I need. Or maybe I don't understand how it can be used to solve the issue. Perhaps I am not explaining this correctly. The tables are already related. I need to use the filtered value as an input in another calculation- I do not want to see it in a table- so it cannot just be a sum using a filter in a visual. I need the cash value as an input for other calculations. What is the formula for a sum that is filtered by a criteria in another table? Just using Sum(value) does not give me a filtered value to use in another calculation.
Thank you
- Anonymous6 years agoNot applicable
ARob198 Your desired result is wrong because the solution provided matches that criteria. Please re-evaluate what your desired result is.
- ARob1986 years ago
Helper IV
Can you be more specific? sum([value]) does not solve my problem without adding a filter and I am having problems creating one inside a measure. If you are unable to provide more help or an explaination or you are unwilling to provide more detail, please allow someone else to repond.
- v-lili6-msft6 years ago
Community Support
hi ARob198
Do you mean that you do a filter in visual level filter and then use the measure result in another Measure?
If so, you need to add the same filter into that visual too, the measure result in based on it row context and filter context.
otherwise, you could define it in the measure like this
Measure =CALCULATE( SUM('Table 1'[Value]),'Table 2'[Type]="Cash")But this will not interaction by slicer.
Regards,
Lin