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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

How to Check if column is availalbe in DAX

Hi Team,

 

We have a scenario where column may avaialble or may not avaialble from backend ( MongoDB ).  We wanted to handle a exception where if a column is not avaialble it should  get replaced by by custom column/ Calculated column in DAX (null values ). Is there any way to handle this in M-Quey or DAX ? 

 

Thanks,

Shubham

 

 

 

2 ACCEPTED SOLUTIONS
parry2k
Super User
Super User

@Anonymous you can handle this in power query not in DAX, check this post

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

Anonymous
Not applicable

HI @Anonymous,

Perhaps you can use the #table function to define the default table structure, then you can load current data into a defined table. (these not existed fields will display with null value)

Creating Tables In Power BI/Power Query M Code Using #table() 

Ensuring Columns Are Always Present In A Table Returned By Power Query 

Regards,

Xiaoxin Sheng

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

HI @Anonymous,

Perhaps you can use the #table function to define the default table structure, then you can load current data into a defined table. (these not existed fields will display with null value)

Creating Tables In Power BI/Power Query M Code Using #table() 

Ensuring Columns Are Always Present In A Table Returned By Power Query 

Regards,

Xiaoxin Sheng

kentyler
Solution Sage
Solution Sage

In M and DAX you can create a calculated column that says

if such a column is null, it lies the value of this other column, otherwise the value of the first column
IF(ISBLANK(column1), IF(ISBLANK(column2, column3),column4)





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


parry2k
Super User
Super User

@Anonymous you can handle this in power query not in DAX, check this post

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

The question was how to handle this in DAX.
The appropriate answer seems to be that there is no function in DAX for testing if a column exists in a table.

You could create a table in dax that had all the columns you wanted (and null or empty values) and append (UNION) it together with your data table, but this is unlikely to be better than an MQuery option.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors