Forum Discussion
Remove filter only on rows to sum but keep context filter
Hi all,
I hope you can help me with the following.
I have the following data set.
| Loan | Region | Borrower | Amount |
| A | EU | Company A | 100 |
| B | EU | Company B | 200 |
| C | US | Company C | 300 |
| E | ASIA | Company D | 400 |
| F | ASIA | Company E | 500 |
| G | ASIA | Company D | 600 |
I want to create a measure that calculates the sum of "Amount" based on Region. The complicating factor is that I want to caculate it based on the Loan selected in a drop down. So for eample, after selecting Loan E, I want the result to be 1500. The Loan E is in ASIA and the total amount for that Region is 1500.
I need something similar with Borrower, but the concept will be the same.
I tried the following: Measure = Calculate( Sum(Data[Amount]), Removefilter(Data[Loan]), Data[Region] = Data[Region])
I think the Removefilter is making me lose the Data[Region] used to filter the Sum(Data[Amount]) but i dont know how to solve that. My searches so far did not get anywhere.
Many thanks!
HI
Var Region=selectedvalue(Data[Region])
return
Calculate( Sum(Data[Amount]), Removefilter(), Data[Region] = Data[Region])