Forum Discussion

art12345's avatar
art12345
Frequent Visitor
2 years ago
Solved

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. 

 

LoanRegionBorrowerAmount
AEUCompany A100
BEUCompany B200
CUSCompany C300
EASIACompany D400
FASIACompany E500
GASIACompany D600

 

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])

2 Replies

  • HI

    Var Region=selectedvalue(Data[Region])

    return

    Calculate( Sum(Data[Amount]), Removefilter(), Data[Region] = Data[Region])

  • art12345's avatar
    art12345
    Frequent Visitor

    This works! Many thanks. 

     

    (Small edit needed at the end I think "... Data[Region] = Region"