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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ddpl
Solution Sage
Solution Sage

What is the key difference between FIRSTNONBLANK and FIRSTNONBLANKVALUE ?

If possible please explain with examples,,,

 

Thanks in Advance.

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @ddpl ,

 

FIRSTNONBLANKVALUE() returns the first non-blank value of <expression> corresponding to the sorted values of <column>.

 

FIRSTNONBLANKVALUE(<column>, <expression>)

 

This function is different from FIRSTNONBLANK in that the <column> is added to the filter context for the evaluation of <expression>. It is equivalent to :

=
CALCULATE (
    <Expression>,
    FIRSTNONBLANK ( <Column Name>, CALCULATE (<Expression> ) )
)

 

I have built a simlply data sample for you to understand:

Measure 1 = FIRSTNONBLANK('Table'[Type],CALCULATE(SUM('Table'[Value])))

Measure 2 = FIRSTNONBLANKVALUE('Table'[Type],CALCULATE(SUM('Table'[Value])))

Measure 3 = FIRSTNONBLANKVALUE('Table'[Type],SUM('Table'[Value]))

Eyelyn9_1-1654666416612.png

  • Measure 1 returns the first Type in the list whose Value are not empty, Since Type is Text ,it will in alphabetical order ,is "B"
  • Measure 2 returns the Value corresponding to the first Type whose Value is not empty, that is, the Value of "B"= the result of the Measure 1 , is 2
  • Measure 3 is the same as Measure 2

Refer to:

FIRSTNONBLANKVALUE function (DAX) - DAX | Microsoft Docs

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @ddpl ,

 

FIRSTNONBLANKVALUE() returns the first non-blank value of <expression> corresponding to the sorted values of <column>.

 

FIRSTNONBLANKVALUE(<column>, <expression>)

 

This function is different from FIRSTNONBLANK in that the <column> is added to the filter context for the evaluation of <expression>. It is equivalent to :

=
CALCULATE (
    <Expression>,
    FIRSTNONBLANK ( <Column Name>, CALCULATE (<Expression> ) )
)

 

I have built a simlply data sample for you to understand:

Measure 1 = FIRSTNONBLANK('Table'[Type],CALCULATE(SUM('Table'[Value])))

Measure 2 = FIRSTNONBLANKVALUE('Table'[Type],CALCULATE(SUM('Table'[Value])))

Measure 3 = FIRSTNONBLANKVALUE('Table'[Type],SUM('Table'[Value]))

Eyelyn9_1-1654666416612.png

  • Measure 1 returns the first Type in the list whose Value are not empty, Since Type is Text ,it will in alphabetical order ,is "B"
  • Measure 2 returns the Value corresponding to the first Type whose Value is not empty, that is, the Value of "B"= the result of the Measure 1 , is 2
  • Measure 3 is the same as Measure 2

Refer to:

FIRSTNONBLANKVALUE function (DAX) - DAX | Microsoft Docs

 

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

vanessafvg
Super User
Super User

https://www.youtube.com/watch?v=UxzUsqjjp-Q





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.