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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.