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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
danialsj
Frequent Visitor

Return column of unique IDs which don't have a specific value

The following is a summary of my data:

ID           TransactionCODE       Amount
1001       OPEN                         1000
1001       CHARGE1                   100
1002       CHARGE1                   70
1002       CHARGE2                   110
1003       OPEN                         1100
1004       OPEN                         1500
1004       CHARGE1                   70
1005       CHARGE1                   90

 

'OPEN' means the cost of opening an account. Sometimes this cost is waived off and therefore no entry is made. 

 

I want to find out which unique IDs don't have the 'OPEN' entry in them. From the above dataset, my result should be a column:

ID
1002

1005

 

(1002 has CHARGE1 and CHARGE2 but no OPEN. 1005 has CHARGE1 but no OPEN)

 

Please help!

 

1 ACCEPTED SOLUTION
Nathaniel_C
Community Champion
Community Champion

Hi @danialsj , 

This is a column added to your data using the code below.


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

 

 

 

 

No Open col = 
var Target = "OPEN"


var ISOPEN = If(CALCULATE(MAX('ID'[ID]),FILTER(ALLEXCEPT('ID','ID'[ID]),'ID'[TransformationCode]=Target)),BLANK(),'ID'[ID])


return ISOPEN

 

NO open.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
Nathaniel_C
Community Champion
Community Champion

Hi @danialsj , 

This is a column added to your data using the code below.


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

 

 

 

 

No Open col = 
var Target = "OPEN"


var ISOPEN = If(CALCULATE(MAX('ID'[ID]),FILTER(ALLEXCEPT('ID','ID'[ID]),'ID'[TransformationCode]=Target)),BLANK(),'ID'[ID])


return ISOPEN

 

NO open.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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