Forum Discussion

adam12asu's avatar
adam12asu
Regular Visitor
6 years ago
Solved

Trimming text or date in time: Powershell API dataset

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. Whi...
  • v-alq-msft's avatar
    6 years ago

    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.