We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I have two queries which may or may not return rows. However, if the primary query is empty then when a refresh is issued there is an error
Column 'anycolumn' in Table 'primaryTable' contains blank values and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table.
Do you have to create a temporary record ... or is there another method of appending ?
@gwizzer wrote:
I have two queries which may or may not return rows. However, if the primary query is empty then when a refresh is issued there is an error
Column 'anycolumn' in Table 'primaryTable' contains blank values and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table.
Do you have to create a temporary record ... or is there another method of appending ?
Based on my test, that error occurs when there exists null values in the "one" table's related column(s).
A solution can be filtering out the null values in "one" table or replacing null with other value.
I don't find this error has anything specific to do with "primary query in apend query return no row". Could you elaborate more details?
If you have any question, feel free to let me know
HI Eric,
No Table 1 has no NULL records ... just create the table. The requirement is that I am appending two task tables into a single view, however, it will happen that either may be blank ... for sure if a record is returned then the ID will not be blank. I have not tested waht you describe below, and the issue only happens when either table is blank
Can you post a picture of the appended query result and the relationships correlated to the table "PrimaryTable" in your case?
I am getting the same exception while appending two tables.
Column 'column 2' in Table 'Current table' contains blank values and this is not allowed for columns on the one side of a many-to-one relationship or for columns that are used as the primary key of a table.
I have made sure that there are no null on primary columns but there are column which has null in current table. I do not understand why does that impact in append ?
Please help me understand this issue.
you can perform "sort of" conditional code branching like described here: http://community.powerbi.com/t5/Community-Blog/Conditional-Code-Branching-in-Power-BI-Query-if-then-...
Just wrap your existing appdend-step into sth like this:
AppendStep = try Table.Combine({Table1, Table2}) otherwise Table2
We're not using "if-then-else" here, because we have to deal with an error message. Therefore: "try-otherwise"
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 17 | |
| 17 |
| User | Count |
|---|---|
| 67 | |
| 62 | |
| 38 | |
| 34 | |
| 22 |