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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
KW123
Helper V
Helper V

IF with multplie accounts

Hi, 

I am having a hard time writing out my IF statement. 

We have unique Customer ID's [CustID] and within those ID's, customers can have different types of accounts [AccountNumber].  We alsohave a column which shows if the accounts are open or closed [Account status]

I want to have a visualization that shows only Customer ID's with all accounts closed.  If I filter out Account Status to "Closed" it will still show Customer ID's with open accounts, but because they have at least one closed account, it is counting it in the filter.  

So the IF statement would be something like
IF customer ID has closed and open accounts, make it "active" 
IF customer ID only has closed accounts, make it "inactive" 

So in the example below, only CustomerID 456 would show on the visualization because Customer 123 still has an open account. 

Cust IDAccount NumberAccount Status
123111Open
123112Closed
456113Closed
789114Open
1 ACCEPTED SOLUTION
Anonymous
Not applicable

hello @KW123 ,
please try:

 

Measure = IF(CALCULATE(SELECTEDVALUE(Table1[Account Status]),ALLEXCEPT(Table1,Table1[Cust ID])) = "Closed","Inactive","Active")

 

 

Screenshot 2022-11-05 021124.png

 

Screenshot 2022-11-05 021330.png

if you found this helpful, please consider accepting it as a solution and a kudos is appreciated

View solution in original post

3 REPLIES 3
KW123
Helper V
Helper V

@Anonymous 

Thank you so much!!! This worked 

Anonymous
Not applicable

hello @KW123 ,
please try:

 

Measure = IF(CALCULATE(SELECTEDVALUE(Table1[Account Status]),ALLEXCEPT(Table1,Table1[Cust ID])) = "Closed","Inactive","Active")

 

 

Screenshot 2022-11-05 021124.png

 

Screenshot 2022-11-05 021330.png

if you found this helpful, please consider accepting it as a solution and a kudos is appreciated

@Anonymous 
Do you have a suggestion for what to do in this case? 

I'd like an IF statement which will show Customer ID's with a total current account balance of $0.00. Similar to above, each Customer ID can have multiple account types with different balances.  I need to pull only the Customer ID with a current total balance of $0.00. 

Customer IDAccount NumberCurrent Balance
1111$0.00
1112$0.00
2113$100
2114$0.00
2115$200
3116$0.00
4117$500
5118$0.00
5119$0.00


So only customer ID 1, 3, 5 should show up in our filter as their total account balance is $0.00 for this filtered month. 

Thank you!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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