Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Using PowerBI for the first time...
I am using a Powershell script to retrieve date & time, text, and numerical values. For reporting I wanted to remove the time from the date and time value. Which I thought I had completed in the powershell script, but a default time of 0:00 or 12:00am gets added back to the values once in Powerbi. Additionally to clean up the presentation I want to remove 'https://www' from the URLs.
powershell date value = Get-Date -DisplayHint Date -Format MM/dd/yyyy
The above is working as expected when we run the script in powershell, but as I said a default value is added once it loads on desktop and report views for PowerBI.
| test_url | pagespeed_score | page_bytes | report_date |
| https://www.testurls.listedhere.com | 80 | 932229 | 3/1/2020 0:00 |
| https://www.testurls.listedhere.com | 79 | 1230234 | 3/1/2020 0:00 |
My question is can you point me to past conversations that may help me fix the formating. It looks like I am unable to use Modeling features due to pulling data from an API vs database. I want to remove characters from the start of URLS, and split date and time using Measures, so far with no luck.
I appriciate your feedback.
Solved! Go to Solution.
Hi, @adam12asu
Based on your description, I created data to reproduce your scenario.
Table:
You may create two measures as follows.
testurlMeasure =
var x = MAX('Table'[test_url])
return
IF(
LEFT(x,11) = "https://www",
RIGHT(x,LEN(x)-LEN(LEFT(x,11)))
)
reportdateMeasure =
var _currentdate = MAX('Table'[report_date])
return
MONTH(_currentdate)&"/"&DAY(_currentdate)&"/"&YEAR(_currentdate)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @adam12asu
Based on your description, I created data to reproduce your scenario.
Table:
You may create two measures as follows.
testurlMeasure =
var x = MAX('Table'[test_url])
return
IF(
LEFT(x,11) = "https://www",
RIGHT(x,LEN(x)-LEN(LEFT(x,11)))
)
reportdateMeasure =
var _currentdate = MAX('Table'[report_date])
return
MONTH(_currentdate)&"/"&DAY(_currentdate)&"/"&YEAR(_currentdate)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-alq-msft Thank you that has saved me and imense amount of time and has formatted both data fields.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 76 | |
| 52 | |
| 51 | |
| 46 |