Forum Discussion
Rename the files name
We are using following measure to get total counts of each types or files.
Source = CALCULATE(COUNT(Source[Source.Name]), ALLEXCEPT(Source,Source[Source.Name]))
On Dashbaord data is displaying as:
| Source.Name |
| ABC.cvs |
| TTS.cvs |
| XYZ.cvs |
| XYZ.cvs |
I want to displays names differently.
e.g: 'ABC.cvs" should be as "Alerts Today"
"TTS.cvs" should be as " Alerts Tomorrow" etc
Appreciate your help. Thanks
sdhn , Create a new column like
Switch([Source.Name],
"ABC.cvs" , "Alerts Today",
"TTS.cvs" ," Alerts Tomorrow"
//Add others
[Source.Name]
)- Source = CALCULATE(COUNT(Source[NCol]), ALLEXCEPT(Source,Source[NCol]))works. Thanks both of you
12 Replies
- amitchandak
Super User
sdhn , Create a new column like
Switch([Source.Name],
"ABC.cvs" , "Alerts Today",
"TTS.cvs" ," Alerts Tomorrow"
//Add others
[Source.Name]
)- sdhn
Responsive Resident
Switch([Source.Name],
"UTRAlerts.cvs" , "Uptime Robot",
"SCOMAlerts.csv" ," SCOM Alerts",
"Reactive Tickets Processed.csv","Reactive Tickets Processed",
"ONMSAlerts.csv","OpenNMS Alert",
"ATAAlerts.csv", "ATA Alerts"
//Add others
[Source.Name]
)The syntax for '[Source.Name]' is incorrect. (DAX(Switch([Source.Name],"UTRAlerts.cvs" , "Uptime Robot","SCOMAlerts.csv" ," SCOM Alerts","Reactive Tickets Processed.csv","Reactive Tickets Processed","ONMSAlerts.csv"
- sdhn
Responsive Resident
Results:
The following syntax error occurred during parsing: Invalid token, Line 6, Offset 1, "ATAAlerts.csv//Add others[Source.Name]))).
- sdhn
Responsive Resident
Getting error
pl. see my last post above
- sdhn
Responsive Resident
NCol = Switch([Source.Name],"UTRAlerts.cvs" , "Uptime Robot","SCOMAlerts.csv" ," SCOM Alerts","Reactive Tickets Processed.csv","Reactive Tickets Processed","ONMSAlerts.csv","OpenNMS Alert","ATAAlerts.csv", "ATA Alerts"//Add others[Source.Name])The syntax for '[Source.Name]' is incorrect. (DAX(Switch([Source.Name],"UTRAlerts.cvs" , "Uptime Robot","SCOMAlerts.csv" ," SCOM Alerts","Reactive Tickets Processed.csv","Reactive Tickets Processed","ONMSAlerts.csv - parry2k
Super User
sdhn looks like you are missing a comma:
NCol = Switch([Source.Name], "UTRAlerts.cvs" , "Uptime Robot", "SCOMAlerts.csv" ," SCOM Alerts", "Reactive Tickets Processed.csv","Reactive Tickets Processed", "ONMSAlerts.csv","OpenNMS Alert", "ATAAlerts.csv", "ATA Alerts", [Source.Name] )✨ 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.
- sdhn
Responsive Resident
Yes. code works but not results.
Here is the baord before code
I used above codes to rename the file, see results
It is totalling all files counts now.
Here is the code for SOURCE:
Source = CALCULATE(COUNT(Source[Source.Name]), ALLEXCEPT(Source,Source[Source.Name]))- sdhn
Responsive Resident
Source = CALCULATE(COUNT(Source[NCol]), ALLEXCEPT(Source,Source[NCol]))works. Thanks both of you
- parry2k
Super User
read my LAST REPLY and apply the fix, no point going back and forth if you don't read the message carefully and apply the change, here it is again
NCol = Switch([Source.Name], "UTRAlerts.cvs" , "Uptime Robot", "SCOMAlerts.csv" ," SCOM Alerts", "Reactive Tickets Processed.csv","Reactive Tickets Processed", "ONMSAlerts.csv","OpenNMS Alert", "ATAAlerts.csv", "ATA Alerts", [Source.Name] ) - sdhn
Responsive Resident
One more thing. It is counting one extra row for each file.
should be as: