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
jruskinparks
Regular Visitor

Lastnonblank problem

Hi All.

 

I have a table in my database called UserRights that has a "role" column and a "department" column (among others). I wrote a measure as follows:

LastDepartment = LASTNONBLANK(SELECTCOLUMNS(Filter(UserRights,UserRights[role]<>"Employee"),"Department",UserRights[department]),1)

Now I'm getting an error "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

 

I'm a little confounded by this as this expression worked just fine until the most recent update of PowerBI desktop (no idea what that could have changed). Further, the SelectColumns statement by itself works as a way to define a table.

 

Thanks for any help.

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

There was an earlier thread around something similar with SELECTCOLUMNS and I believe that it was flagged as a bug. Try searching for it in the forums. It may have been posted to the Ideas or Issues forums as well.

 

Found the threads:

https://community.powerbi.com/t5/Issues/SELECTCOLUMNS-select-only-one-column-doesnt-work-anymore-wit...

https://community.powerbi.com/t5/Issues/DAX-SELECTCOLUMNS-function-works-in-desktop-but-fails-on-web...

 

May not be the same issue, but sounds like there is something up in general with the SELECTCOLUMNS statement recently.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
aviral
Advocate IV
Advocate IV

It took some time for me to realize that the probelm was

being caused by SELECTCOLUMNS() and not LastNonBlank.

 

I found the last month's installer of PowerBI in downloads folder.

Identified it by the last modification date.

Uninstalled the current month's (August-2017) app and

reinstalled the one from last month.  

 

The dataset refreshed successfully. 

 

I think they will have to release an earlier update to fix this. 

 

Just thinking aloud. Is using SELECTCOLUMNS() a bad practice? 

 

I there any other preferable way to get

a list of scalers from a column after filtering it?  

Not sure about a violoation of best practice but you could also consider creating another table in your model and selecting out the columns that you need and removing the others in the query.

 

I've never actually found a reason for using SELECTCOLUMNS as that's sort of what visuals are for in my opinion but I suppose its there for a reason but I would be interested in what the actual use case is.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

There was an earlier thread around something similar with SELECTCOLUMNS and I believe that it was flagged as a bug. Try searching for it in the forums. It may have been posted to the Ideas or Issues forums as well.

 

Found the threads:

https://community.powerbi.com/t5/Issues/SELECTCOLUMNS-select-only-one-column-doesnt-work-anymore-wit...

https://community.powerbi.com/t5/Issues/DAX-SELECTCOLUMNS-function-works-in-desktop-but-fails-on-web...

 

May not be the same issue, but sounds like there is something up in general with the SELECTCOLUMNS statement recently.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.