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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
dwel0120
Helper III
Helper III

Include Value if any of the selected columns are not blank

I am trying to include values in a new table from an existing table IF any one of the columns is not blank. 

 

Here is my current query: 

 

Selector =
SELECTCOLUMNS('GEO_ADULT',
"State",'GEO_ADULT'[STATENAME],
"City",'GEO_ADULT'[CITY],
"Latitude",'GEO_ADULT'[LAT],
"Longitude",'GEO_ADULT'[LON]
)
 
dwel0120_0-1643919738660.png

 

1 ACCEPTED SOLUTION

Hi @dwel0120 ,

 

It is easier to implement in Power Query Editor.

 

let
    Source = Table.FromValue(GEO_ADULT),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Columns", each [Value] <> null and [Value] <> ""),
    #"Selected Columns" = Table.SelectColumns(Source,List.Distinct(#"Filtered Rows"[Attribute]))
in
    #"Selected Columns"

vkkfmsft_0-1644476447889.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

6 REPLIES 6
tamerj1
Super User
Super User

Hi @dwel0120 

It is possible only if you have a fixed number of columns. If this is ok with you then I'll post my solution by tomorrow. Thanks!

ValtteriN
Super User
Super User

Hi,

Try this kind of logic:

SELECTCOLUMNS(FILTER(ItemExample,not(ISBLANK(ItemExample[Column]))||not(ISBLANK(ItemExample[Item]))),
"Item",ItemExample[Item],"column",ItemExample[Column])
 
ValtteriN_0-1643921160414.png

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




That didn't work...

 

Selector =
SELECTCOLUMNS(FILTER('GEO_ADULT', not(ISBLANK(GEO_ADULT[STATENAME]))||not(ISBLANK(GEO_ADULT[CITY]))||not(ISBLANK(GEO_ADULT[LAT]))||not(ISBLANK(Geo_Adult[lon]))),
"State",'GEO_ADULT'[STATENAME],
"City",'GEO_ADULT'[CITY],
"Latitude",'GEO_ADULT'[LAT],
"Longitude",'GEO_ADULT'[LON]
)

dwel0120_0-1643922223619.png

 

Hi @dwel0120 ,

 

It is easier to implement in Power Query Editor.

 

let
    Source = Table.FromValue(GEO_ADULT),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Columns", each [Value] <> null and [Value] <> ""),
    #"Selected Columns" = Table.SelectColumns(Source,List.Distinct(#"Filtered Rows"[Attribute]))
in
    #"Selected Columns"

vkkfmsft_0-1644476447889.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Are you creating this as a blank query?

Hi @dwel0120 ,

 

Yes, I created a blank query.

 

Best Regards,
Winniz

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.