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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Mouse
Frequent Visitor

Stumped with a calculated column

I want to created a calculated column, not a measure.

I need the formula to filter within the table, to aproject, and then return the first nonblank sting from another column in the same table, using an index column to determin what that first position is.

In baby-speak I need filter to {ProjectID], retun first nonblank value from [Progress] where "first" is min [TaskID]

Results would look like the blue column. It is absolutely doing this newbie's head in. Please help!

Mouse_0-1721958004241.png

 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @Mouse 

Try this:

 

First Progress = 
CALCULATE (
    FIRSTNONBLANKVALUE (
        YourTable[Task Index],
        SELECTEDVALUE ( YourTable[Progress] ) -- auto context transition from FIRSTNONBLANKVALUE
    ),
    ALLEXCEPT ( YourTable, YourTable[ProjectId] )
)

 

The blank values in the Progress column must be genuinely blank (rather than empty strings) for this to work.

 

Does it work as expected for you?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

4 REPLIES 4
OwenAuger
Super User
Super User

Thanks for testing that @Mouse  🙂

The blank values look good, and the DAX expression itself should be fine as it works in a test model at my end (attached for comparison).

 

Regarding the error, it looks like the type of the column First Progress might have been set incorrectly.
Can you check that it's set to text?

 

OwenAuger_0-1721961936216.png

Alternatively, is there anything else in the query or DAX expression behind this table that might be causing type-related issues?

 

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

omg I'm SUCH a muppet!!! That'll teach me to recycle a column. Owen you are a star. Thank you so very much.

OwenAuger
Super User
Super User

Hi @Mouse 

Try this:

 

First Progress = 
CALCULATE (
    FIRSTNONBLANKVALUE (
        YourTable[Task Index],
        SELECTEDVALUE ( YourTable[Progress] ) -- auto context transition from FIRSTNONBLANKVALUE
    ),
    ALLEXCEPT ( YourTable, YourTable[ProjectId] )
)

 

The blank values in the Progress column must be genuinely blank (rather than empty strings) for this to work.

 

Does it work as expected for you?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Hi Owen,

 

Thank you somuch for your reply, I really appreciate it!

Unfortunaely I got this error, which I've seen before in my attempts and I don't understand why.

Mouse_0-1721960710670.png


Here are the outputs I'm trying to filter to, and the blank is (I think) a true blank as it's generated by the "else" of a switch calc that ends with Blank()

Mouse_1-1721960824733.png

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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