Forum Discussion
MAX datetime truncates to date???
- 5 months ago
Hi mike_asplin,
When you use MAX('Refresh Time'[Refresh Time])
Power BI returns a DateTime value internally, but:
- The Card visual auto-formats it
- And often defaults to showing only the date part
To avoid this
Select your column 'Refresh Time'[Refresh Time], change format to dd MMM yyyy HH:mm:ss
now you can use it in MAX and you should get the correct results.
If not then Use Format
If the issue is fixed, Mark it as accepted solution
Hi mike_asplin,
You are actually hardcoding it by providing 00:00.
Use below DAX instead
Last Refresh =
FORMAT(
MAX('Refresh Time'[Refresh Time]),
"dd MMM yyyy HH:mm"
)
π I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
π‘ Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
π As a proud SuperUser and Microsoft Partner, weβre here to empower your data journey and the Power BI Community at large.
π Curious to explore more? [Discover here].
Letβs keep building smarter solutions together!
- mike_asplin5 months agoHelper V
well that was dumb of me!!!
I only added the format because when I did MAX('Refresh Time'[Refresh Time]) I just got the date. Is that expected and you have to add the FORMAT bit?
- grazitti_sapna5 months agoSuper User
Hi mike_asplin,
When you use MAX('Refresh Time'[Refresh Time])
Power BI returns a DateTime value internally, but:
- The Card visual auto-formats it
- And often defaults to showing only the date part
To avoid this
Select your column 'Refresh Time'[Refresh Time], change format to dd MMM yyyy HH:mm:ss
now you can use it in MAX and you should get the correct results.
If not then Use Format
If the issue is fixed, Mark it as accepted solution
- mike_asplin5 months agoHelper V
Ok that odd as did have it formated as a datetime column, but seems ok now without the FORMAT added to the measure.
Thanks for your help