Forum Discussion
Merge csv files with new name
Hello All,
I am using Power Bi desktop to develop reports. I have merged multiple files onto one file called source.
All 4 files has same format and structure.
On my new file Source.Name column is displaying as below:
| Source.Name | Owner |
| abc.csv | Jim |
| abc.cvs | Jim |
| abc.csv | Jim |
| efg.csv | Aike |
| efg.csv | Aike |
| xyz.csv | Plus |
| xyz.csv | Plus |
| mno.csv | Divide |
| mno.csv | Divide |
I am displaying total counts of each file on the Dashboard :
I wrote a measure to dispay row counts for each source.name.
| Source.Name | Source |
| abc.csv | 3 |
| efg.csv | 2 |
| xyz.csv | 2 |
| mno.csv | 2 |
I want to display source.name differently. such as ABC Alerts , EFG Alerts etc
right now it is picking file name as default. Thanks
- Anonymous4 years ago
Hi sdhn ,
Here are the steps you can follow:
1. Create measure.
Measure = UPPER( LEFT(MAX('Table'[Source.Name ]),3))&" "&"Alerts"2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
6 Replies
- amitchandak
Super User
sdhn , Create a new column in power query or DAX
DAX Column // Power Query use if then else
Switch([Source.Name],
"abc.csv","ABC Alerts" ,
"efg.csv","EFG Alerts",
//add other
"Other"//default value
)
- sdhn
Responsive Resident
I wrote measure as:
Rename Col. = SWITCh([Source],"ABC.csv","ABC Alerts", "EFG.csv","EFG Alerts", //add other"Other"//default value)No error.But when I checked on measure to display on DB.- sdhn
Responsive Resident
Rename Col. = SWITCh([Source],"ABC.csv","ABC Alerts", "EFG.csv","EFG Alerts")
still same result
- parry2k
Super User
sdhn you should add it is as a column, not a measure:
✨ Follow us on LinkedIn and to our YouTube channel
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.
- AnonymousNot applicable
Hi sdhn ,
Here are the steps you can follow:
1. Create measure.
Measure = UPPER( LEFT(MAX('Table'[Source.Name ]),3))&" "&"Alerts"2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly