Forum Discussion
Power Automate - "Run a query against a dataset" - missing columns from Power BI semantic model
Hi PetterR ,
So when sparse columns (e.g., <1% populated) contain only blanks in the initial few rows, they’re excluded from the CSV output, because Power Automate doesn't "see" them as present.
Why This Happens:
-
The "Create CSV Table" action does not use the full schema from the dataset.
-
It only includes columns present in the first few data rows (likely based on internal sampling).
-
If a column is entirely null or blank() in early rows, it may be omitted.
-
There’s no exposed “Include all columns” setting in this action.
Best Workaround (No Complex Data Rework):
1. Use a fixed schema via manual column mapping (recommended): Add a "Select" action before "Create CSV Table". Explicitly define the 15 expected columns (even if the value is null or empty). This forces "Create CSV Table" to include all headers consistently, regardless of sparsity.
Steps:
-
Insert “Select” action before CSV creation.
-
Map each field like:
"Column1" → items('Apply_to_each')?['Column1']
(Or whatever your structure is.)
Optional Alternatives:
2. Sort your DAX output so populated rows come first
-
Already tested by you — this works, but it’s data-dependent and not as robust.
3. Modify DAX to replace blanks with placeholders:
IF(ISBLANK([MyColumn]), "No Data", [MyColumn])
-
Works, but requires editing the DAX query and changes data semantics slightly.
4. Export to Excel instead of CSV:
-
Use “Create Excel File” action — tends to preserve all columns better.