March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I am trying to figure out the best way to go about trimming a column, but only when it meets a certain criteria. And leave the Urls as they are that don't meet the criteria.
I want to rollup all the Urls that contain '/dispatch/calendar/daily/xxxx-xx-xx' into one row in the Report view '/dispatch/calendar/daily/' to get a better sense of how often the daily calendar is used and not the individual days
Solved! Go to Solution.
Create this calculated column and use it in your visual (use your table name instead of Table1):
sUrl Trimmed =
IF (
CONTAINSSTRING ( Table1[sUrl], "/dispatch/calendar/daily/" ),
"/dispatch/calendar/daily/",
Table1[sUrl]
)
Proud to be a Super User!
Glad to hear that works. I recommend the SWITCH function for nesting:
sUrl Trimmed =
SWITCH (
TRUE,
CONTAINSSTRING ( Table1[sUrl], "/dispatch/calendar/daily/" ), "/dispatch/calendar/daily/",
CONTAINSSTRING ( Table1[sUrl], "/marketing/keyword/" ), "enter text here",
Table1[sUrl]
)
Proud to be a Super User!
Create this calculated column and use it in your visual (use your table name instead of Table1):
sUrl Trimmed =
IF (
CONTAINSSTRING ( Table1[sUrl], "/dispatch/calendar/daily/" ),
"/dispatch/calendar/daily/",
Table1[sUrl]
)
Proud to be a Super User!
Absolutely wonderful ty so much.... works like a charm.... Also one follow up, I assume it would work if I used it in a nested query too.. if I had other url's that needed a trim like say "marketing/keyword/"
Glad to hear that works. I recommend the SWITCH function for nesting:
sUrl Trimmed =
SWITCH (
TRUE,
CONTAINSSTRING ( Table1[sUrl], "/dispatch/calendar/daily/" ), "/dispatch/calendar/daily/",
CONTAINSSTRING ( Table1[sUrl], "/marketing/keyword/" ), "enter text here",
Table1[sUrl]
)
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
167 | |
117 | |
63 | |
57 | |
50 |