Forum Discussion
Replacement for Union in Direct Query
- 5 years ago
Hi Anonymous ,
According to the official document , Calculated tables aren't supported:
So, you could create the A, B, C three columns as three measures, and then use βunion() βto achieve , as follows:
First: create three measures
Ameasure = MAX('Table'[A])BMeasure = MAX('Table'[B])Cmeasure = MAX('Table'[C])Then create new table:
newTable = DISTINCT ( UNION ( SELECTCOLUMNS ( 'Table', "Type", "A", "Description", [Ameasure] ), SELECTCOLUMNS ( 'Table', "Type", "B", "Description", [BMeasure] ), SELECTCOLUMNS ( 'Table', "Type", "C", "Description", [Cmeasure] ) ) )The final output is shown below:
Last, If we create a virtual table with union(), the storage mode will change to mixed mode.
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. - 5 years ago
Hi, Anonymous
You could see my pbix file. Your data source is still in DQ mode. Since you created a virtual table with union(), it is mix(), which does not affect your data source itself.
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , As far as I understood this transformation is only possible in import mode
- Anonymous5 years agoNot applicable
So, no TRANSPOSE.. and also no UNION...
No other tricks ? π
- amitchandak5 years agoSuper User
Anonymous , I was think of usin userealtionship with a table having distinct names (that can be as import mode table if needed)
But that depend of requirements https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in-power-bi
In this manner we can take total from three columns
also run time union in a measure, depend on need