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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Should I even use firstnonblank?

I'm using the approach below to filter a table for a specific value (knowing the result is unique) by using Firstnonblank. 
Are there any approaches that are more effecient to achieve the same? I'm checking if the line returned contains the value "vrijgegeven" in the particular column.

 

RemyBosman_0-1614091225397.png

 

3 REPLIES 3
AmedeoM
Regular Visitor

Hello,

 

if you're 100% sure the result will be unique with those filters, you could use another aggregation as well (or no aggregation at all):

CALCULATETABLE ( 
	VALUES/DISTINCT/MIN/MAX ( VrijgaveCompleetheid[crc06_vrijgavestatus] ),
	<filters>
) = "Vrijgegeven"

 

This should work as well, without the need of using FIRSTNONBLANK.

However, be aware of the fact that VALUES will raise an error in the result is not unique (i.e. if you have two or more rows as a result). In that case, an aggregator like MIN/MAX would do the trick

 

Please let me know if this helps 🙂

Anonymous
Not applicable

Thanks  for sharing your approach Amedeo, this works indeed. 

I assuming for now that using firstnonblank in this particular case is not "wrong". I actually felt that there must me be a more suitable approach for this simple task. 

Anonymous
Not applicable

For optimization of LASTNONBLANK and similar functions, please see Optimizing LASTNONBLANK and LASTNONBLANKVALUE calculations - SQLBI.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.