Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
hi all,
Greetings,
Is the way to Extract AM or PM from Datetime format in direct query without changing to Import storage.
Or is there any another way to create another table or colume to extract time and convert to AM / PM
Solved! Go to Solution.
Hi @askspepsi ,
You could try to refer to @Greg_Deckler 's measure, and change it and apply this in table visual like below
Measure = IF(RIGHT(MAX('Table1'[date]) & "",2)=SELECTEDVALUE('Table'[time]), 1,0)
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@askspepsi - OK, if I understand correctly use HOUR. If it is >= 12 it is PM otherwise AM
https://docs.microsoft.com/en-us/dax/hour-function-dax
@askspepsi Should be able to use DAX to parse that using RIGHT, like maybe:
Measure = RIGHT(MAX('Table'[Datetime]) & "",2)
@Greg_Deckler thanks for the update.
iam really sorry i was not clear in the question i asked, let me rephrase again.
i have column name with datetime (see the below) and create AM / PM when i select AM the 06:00 and 5:50 only and when i select PM i what 17:58 and 17:59
2020-07-23 17:58:57.000 |
2020-07-23 17:59:02.000 |
2020-07-23 06:00:37.000 |
2020-07-23 05:50:25.000 |
@askspepsi - OK, if I understand correctly use HOUR. If it is >= 12 it is PM otherwise AM
https://docs.microsoft.com/en-us/dax/hour-function-dax
Hi @askspepsi ,
You could try to refer to @Greg_Deckler 's measure, and change it and apply this in table visual like below
Measure = IF(RIGHT(MAX('Table1'[date]) & "",2)=SELECTEDVALUE('Table'[time]), 1,0)
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
99 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |