The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Solved! Go to Solution.
@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.
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
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
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)
Help when you know. Ask when you don't!
@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.