Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I have the data in columns,
VALUES (Some Column) and I wanted to somehow with DAX, convert column rows into a CSV - Row1, Row 2, Row 3, etc.
Thanks in advance.
Solved! Go to Solution.
Hi @Anonymous ,
Here are two output for your scenario.
Firstly, if you want to get the output below, you could use dax expression.
You could create the measure with the formula below.
Measure = CONCATENATEX('Table1','Table1'[Column],",")
If you want to get the Apple, Banana, Grape as a column name, you could achieve in Query Editor.
1. Transpose the Table.
2. Merge the columns.
3. Use first Row as header
Hope this can help!
Best Regards,
Cherry
This is the CSV file that I need to convert into DAX DATATABLE:
id,name,age,gender
1,Roberta,39,M
2,Oliver,25,M
3,Shayna,18,F
4,Fechin,18,M
And this is the processed result:
DATATABLE (
"id", STRING,
"name", STRING,
"age", STRING,
"gender", STRING,
{
{ "1", "Roberta", "39", "M" },
{ "2", "Oliver", "25", "M" },
{ "3", "Shayna", "18", "F" },
{ "4", "Fechin", "18", "M" }
}
)
So, how does it quickly realize this requirement? An online tool is used here: https://tableconvert.com/csv-to-dax
it can also convert HTML Table, JSON, Markdown Table or Excel to DAX.
Note that your data is safe as all its conversion processing is done in your browser.
Hi @Anonymous ,
I'm afraid that we cannot change the column name in the original table with dax.
If it is convenient, could you share some data sample and your desired output so that I could understand your scenario better and try other ways.
Best Regards,
Cherry
Hi there,
Thanks for your message.
I am looking to convert some values returned in a column to comma separated values.
For e.g.
Input-
ALLSELECTED ('Products'[Product Name])
Apple
Banana
Grape
SOMEHOW WRITE A DAX TO MAGICALLY OUTPUT - CSV LIST
Apple, Banana, Grape
I hope this helps. Looking forward to any solution. Thanks.
Hi @Anonymous ,
Here are two output for your scenario.
Firstly, if you want to get the output below, you could use dax expression.
You could create the measure with the formula below.
Measure = CONCATENATEX('Table1','Table1'[Column],",")
If you want to get the Apple, Banana, Grape as a column name, you could achieve in Query Editor.
1. Transpose the Table.
2. Merge the columns.
3. Use first Row as header
Hope this can help!
Best Regards,
Cherry
Hi there!
I have a similar scenario to convert list to csv grouped by ID column, please help!
Input:
ID Name
1 A
1 B
1 C
2 D
3 E
3 F
Output:
ID Name
1 A,B,C
2 D
3 E,F
THANK YOU VERY MUCH!!
I cant believe it was that simple. 😉
User | Count |
---|---|
93 | |
84 | |
78 | |
75 | |
66 |
User | Count |
---|---|
115 | |
105 | |
93 | |
65 | |
60 |