Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to search a column values from another table column using IN Operator

I have  6 columns as below:

Table Name: Fixed_Deposit

Customer IDAccount NoAccount TypeBase ValueCurrent ValueFlag
12345100011010Fixed Deposit100011111
12345100001000Saving Account1001110
12345100100100Saving Account100000100000
21223123312233Fixed Deposit100011122230
21223123323212Saving Account1010112231230
31221231233212Fixed Deposit122121233211
31221123321332Current Account2312123310
32222433434312Fixed Deposit222111222120
12345233323232Current Account222212212220

 

Now, I have a flag set to 1 for all the Fixed Deposit accounts. I need the sum of their Base Amount and Current Amount as 2 seperate columns in the matrix.

How do I get this?

 

I have used the below dax query:

I have created a new table using below Dax:

Unique_Customer = CALCULATETABLE(DISTINCT(Fixed_Deposit[Customer ID]),Fixed_Deposit[Flag]=1)
 
Then I created a measure on my base table using below query:
FD CA Base = var a = DISTINCT(Unique_customer[Customer ID])
return
CALCULATE(SUM(Fixed_Deposit[Base Value])/10000000,FILTER(Fixed_Deposit,Fixed_Deposit[Customer ID] in a),FILTER(Fixed_Deposit,Fixed_Deposit[Account Type]="Current Account"))
 
Respectively for Savings Account and Fixed Deposit Accounts. 
 
Required Output:
Customer IDBase CA AmountBase SA AmountBase FD Amount
1234522221001001000
312212312012212

 

 

2 REPLIES 2
Anonymous
Not applicable

@Greg_Deckler - Base CA means Base Value for Account Type =  "Current Account"

Similarly for Base SA and Base FD.

Greg_Deckler
Super User
Super User

@Anonymous - Where is the Base CA column coming from?


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors