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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
HappyHammer15
New Member

Finding FIRSTNONBLANK with multiple filters

Hi,

 

New to PowerBI and have hit my first wall. 

I have 2 tables with a one to many relationship under Contact No. and I am trying to find the first interaction in another table based on multiple criteria. 

 

I have tried creating a new column with the following criteria which is very messy but the only way i've managed to figure something out. However, I am now getting an error that there is not enough memory to complete this operations.

 

Can someone please help me find a better way to do this?

I have tried using an array instead but get an error on multiple values when a single value was expected. 

Any help appreciated and please let me know if you need more information. 

 

 

First Interaction = calculate(
 
    firstnonblank('Interaction Log Entry'[Interaction Template Code],1),
    filter(ALL('Interaction Log Entry'),'Interaction Log Entry'[Contact No_]=Contact[No_] && 'Interaction Log Entry'[Interaction Template Code]="INORDFAIL"||'Interaction Log Entry'[Interaction Template Code]="INPHONE"||'Interaction Log Entry'[Interaction Template Code]="INLETTER"||'Interaction Log Entry'[Interaction Template Code]="INEMAIL"||'Interaction Log Entry'[Interaction Template Code]="INCONTACT"||'Interaction Log Entry'[Interaction Template Code]="INCALLBACK"||'Interaction Log Entry'[Interaction Template Code]="PHONETICKE"||'Interaction Log Entry'[Interaction Template Code]="LIVECHAT"||'Interaction Log Entry'[Interaction Template Code]="INSAVEDBAS"||'Interaction Log Entry'[Interaction Template Code]="INFAQFORM"||'Interaction Log Entry'[Interaction Template Code]="INEBROCH"||'Interaction Log Entry'[Interaction Template Code]="FACEBOOK"||'Interaction Log Entry'[Interaction Template Code]="EMAILTICKE")
    )
 
Thanks
2 REPLIES 2
HappyHammer15
New Member

@amitchandak 

Thank you for your reply. The measure worked correctly but I was hoping to have a calculated column that I could use for further visuals if possible.

A measure as I understand is limited as it doesnt associated with the rest of the table. 

I tried using the working measure to calculate a column in the Contact Table but it only returned one result for every Contact No.

HappyHammer15_0-1674665935300.png

 

Thanks again for your assistance.

amitchandak
Super User
Super User

@HappyHammer15 , In measure when you use other table you have use max or selected value

Contact

 

You can use in for multiple value, I have put some sample values 

 

example measure =

 

calculate( firstnonblank('Interaction Log Entry'[Interaction Template Code],1),
filter('Interaction Log Entry','Interaction Log Entry'[Contact No_]= max(Contact[No_]) && 'Interaction Log Entry'[Interaction Template Code] in {"INORDFAIL", "INPHONE","INLETTER","INEMAIL","INCONTACT","INCALLBACK","PHONETICKE")
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.