Forum Discussion
Cannot put a changing status on a table row
- 9 years ago
Hi IanR,
Is there a way to stop ALL from bringing back only unique records, or is there another table function that can bring back selected columns without applying a DISTINCT?
Actually, when combine two tables (some selected columns) into a single one, it will return all data rows rather than return distinct values. So, in your scenario, not sure how you created the calculated table via UNION function, please provide sample data of source tables. According to current description, it's hard to imagine your table structure and not very clear about your requirement. It would be better you could elaborate your scenario with some examples.
Is there a way, in a function like ALL, to add a literal value to a column? Something like:
SELECT Column_A, ‘iteral value’ AS Column_B FROM Opportunities
Does this meet your requirement?
Table = UNION ( SELECTCOLUMNS ( Table1, "Col1", Table1[Table1_col1], "Col2", Table1[Table_col2] ), SELECTCOLUMNS ( Table2, "Col1",Table2[Table2_col1], "Col2", "iteral value" ) )Best regards,
Yuliana Gu
I think what I need to do is create a calculated ‘opportunity events’ table in DAX via a UNION function. This will effectively append Open events data from the Opportunities table to Won and Lost events data, also from the opportunities table. I still have a couple of questions:
Is there a way to stop ALL from bringing back only unique records, or is there another table function that can bring back selected columns without applying a DISTINCT?
Is there a way, in a function like ALL, to add a literal value to a column? Something like:
SELECT Column_A, ‘iteral value’ AS Column_B FROM Opportunities
Thanks
Ian
Hi IanR,
Is there a way to stop ALL from bringing back only unique records, or is there another table function that can bring back selected columns without applying a DISTINCT?
Actually, when combine two tables (some selected columns) into a single one, it will return all data rows rather than return distinct values. So, in your scenario, not sure how you created the calculated table via UNION function, please provide sample data of source tables. According to current description, it's hard to imagine your table structure and not very clear about your requirement. It would be better you could elaborate your scenario with some examples.
Is there a way, in a function like ALL, to add a literal value to a column? Something like:
SELECT Column_A, ‘iteral value’ AS Column_B FROM Opportunities
Does this meet your requirement?
Table =
UNION (
SELECTCOLUMNS (
Table1,
"Col1", Table1[Table1_col1],
"Col2", Table1[Table_col2]
),
SELECTCOLUMNS ( Table2, "Col1",Table2[Table2_col1], "Col2", "iteral value" )
)
Best regards,
Yuliana Gu
- IanR9 years agoHelper III
UNION and SELECTCOLUMNS.
Perfect.