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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
tylermontney
Regular Visitor

FIRSTNONBLANK returns blank

I want to return a columns first non blank value.

 

LastLogon = FIRSTNONBLANK('TestReport'[Account_Name], 1) & " was the last to logon."

Unfortunately, it returns nothing. I can verify the column I'm referring to has at least one value.

 

example.png

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

@tylermontney

 

The formula you provided should work if the rest value of column Account_Name is Blank(except value "tyler.montney"). Now the formula does not get the expected value, so I assume the rest value of the column Account_Name is not Blank, it is empty("").

 

In this case, the following formula should work:

LastLogon = 
CALCULATE (
    FIRSTNONBLANK ( 'TestReport'[Account_Name], 1 ) & " was the last to logon.",
    TestReport[Account_Name] <> ""
)

 

View solution in original post

3 REPLIES 3
v-subash2
New Member

FIRSTNONBLANK ( 'TestReport'[Account_Name], 1 ) +1

use this query

 I think this would be solved problem 

v-ljerr-msft
Microsoft Employee
Microsoft Employee

@tylermontney

 

The formula you provided should work if the rest value of column Account_Name is Blank(except value "tyler.montney"). Now the formula does not get the expected value, so I assume the rest value of the column Account_Name is not Blank, it is empty("").

 

In this case, the following formula should work:

LastLogon = 
CALCULATE (
    FIRSTNONBLANK ( 'TestReport'[Account_Name], 1 ) & " was the last to logon.",
    TestReport[Account_Name] <> ""
)

 

How would you compare "blank" and "empty". As in null/nothing blank?

 

PBDC-LT-16.PBDC.local,,12:45 june/30/2016,,C:\Windows\System32\cmd.exe,,

 

I can see "empty" being a whitespace as a value. Above is an example of what blank should be (where a comma delimted value has absolutely nothing in it).

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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