web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Run a Query Against a ...
Power Automate
Unanswered

Run a Query Against a Dataset - How to Replace Null/Blank Values

(0) ShareShare
ReportReport
Posted on by 14

Hello everyone,

 

Newbie here in Power Automate. And I've spent the last few days trying to find a material that'd be helpful for my case as I think this might be quite a common issue. But somehow, I can't find one that addresses my problem. Or at least I don't know how to apply it in my case I guess. 

 

So, I am creating a flow to export data from a DirectQuery Power BI dataset into csv file in Sharepoint. 

There are around 60 to 70 columns and over 50k rows. 

I have followed Curbal's solution for this (Export MORE THAN 100k rows of Power BI data to CSV using Power Automate | No ROW limits! (youtube.com)) and I was able to successfully export all 50k rows in one csv output. 

 

The catch is, when I reviewed the output, some columns had mismatching values.  And when I inspected further, I realized that if the first row in the dataset has a blank (or null?) value, those columns with blank or null values are skipped.  Then, if the succeeding rows already had values for those columns, they are added back but they get added as the last column in the output.  Hence, this messes the arrangement of the columns.. so when you do a run with multiple loops, any loop where the first row had blank values will mess up the final combined output file. 

 

So my thinking is that there has to be a way to replace all null values to maybe a zero or an 'n/a' so that the flow does not skip the column whenever the first row in the loop happens to have a blank value in one or more of its columns.  

 

I have read about potentially adding a COALESCE function, or a "IF(EMPTY(" conditional function to thew flow but all the examples I saw had input data as either manually coded/initialized or from a Sharepoint list.  I wonder how to apply the same fix for my case where the data is from a DirectQuery PowerBI dataset. 

 

To visualize,

imagine this is the data from the PBI dataset:

HouseOfRael_0-1709026203908.png

 

Once I run the flow, the csv output will have the data looking like this:

HouseOfRael_1-1709026243777.png

 

Column "History" whose first row is blank (or null?) in the dataset gets pushed to the last column in the output. 

 

I hope someone will be able to help me on this. 

 

Thanks!

Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,716 Super User 2026 Season 1 on at

    When you run a query against a Power BI Semantic Model you should never exclude blanks.  

     

    You can run whatever DAX queries you want, including using SELECTCOLUMNS (to rename the columns) and COALESCE  (to fill in the blanks with something else).  

     

    What does your current DAX look like?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 474

#2
11manish Profile Picture

11manish 268

#3
David_MA Profile Picture

David_MA 243 Super User 2026 Season 1

Last 30 days Overall leaderboard