Forum Discussion
alir22456
2 years agoHelper I
Export Visual to CSV
Hi, I have created a Table viusalization in my Power BI report. The table consists of a list of names of customers. I did export the visualization to csv, but the measure name was also exported alon...
alir22456
2 years agoHelper I
Hi MFelix
Thank you for your comment. Can you please tell me how can I modify the below formula to get a list of customer names each in a separate row rather than seperated by comma.
Cohort =
VAR __tmpTable1 =
GENERATE(
DISTINCT('Table'[Customers]),
EXCEPT(
DISTINCT('Table'[Services]),
CALCULATETABLE(DISTINCT('Table'[Services]))
)
)
VAR __tmpTable2 = SUMMARIZE(__tmpTable1, 'Table'[Customers])
VAR __tmpTable3 = EXCEPT(DISTINCT('Table'[Customers]), __tmpTable2)
VAR __Result = CONCATENATEX(__tmpTable3, [Customers], ",", [Customers])
RETURN
__Result
Note: I need the names in a new row not a line break
Thanks
MFelix
2 years agoSuper User
Hi alir22456 ,
Try the following code:
Cohort =
VAR __tmpTable1 =
GENERATE(
DISTINCT('Table'[Customers]),
EXCEPT(
DISTINCT('Table'[Services]),
CALCULATETABLE(DISTINCT('Table'[Services]))
)
)
VAR __tmpTable2 = SUMMARIZE(__tmpTable1, 'Table'[Customers])
VAR __tmpTable3 = EXCEPT(DISTINCT('Table'[Customers]), __tmpTable2)
VAR __Result = CONCATENATEX(__tmpTable3, [Customers], UNICHAR(10), [Customers])
RETURN
__Result
Unichar(10) is the line break character.