Forum Discussion
Logic Within "Get Data"
- 4 years ago
Hi Anonymous ,
You can add the following code to the M of the data source, below is my example using Excel as the data source.
Rows = Table.RowCount(#"Promoted Headers"), Table = if Rows > 0 then #"Promoted Headers" else Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t])1. When the data in the excel is empty, display the custom data.
2. When the excel data is not empty, import it.
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.
My source is a website that returns a DataSourcePath error, presumably meaning the website location does not currently exist. However, at certain times in the month, this website path does contain data uploaded and active.
Hi Anonymous ,
You can add the following code to the M of the data source, below is my example using Excel as the data source.
Rows = Table.RowCount(#"Promoted Headers"),
Table = if Rows > 0 then #"Promoted Headers" else Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t])
1. When the data in the excel is empty, display the custom data.
2. When the excel data is not empty, import it.
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.