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
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 agoHelper 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.
- Anonymous6 years agoNot applicable
ARob198I think we are talking past each other here. What I meant was, the problem as you had laid it out was solved in the solution by v-lili6-msft . However, you are saying that is incorrect. I was trying to simply propose that you reframe the problem more specifically so members of this forum can help you.
As an aside, cross table filters are based on the relationships of the tables, and those relationships are enforced inside measures, unless you modify them the filter with a formula like ALL, SELECTED, and so on. You can find a filter function overview here: https://docs.microsoft.com/en-us/dax/filter-functions-dax
- v-lili6-msft6 years agoCommunity 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