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 everyone,
I have made a DateTime table. I am struggeling to get the DateTime column in my table to display the minute of the day.
How would i edit the code below to get it to also display minutes.
All help is appreciated.
Thank you in advance
To add the minute of the day to the DateTime column, you can modify the "DateTime" column definition in the ADDCOLUMNS function as follows:
"DateTime", [Date] + TIME([Value], ROUND(MOD([Value],1)*60,0), 0)
This will add the minute component to the TIME function, which calculates the time of day based on the hour from the "Value" column and the minute from rounding the decimal part of the "Value" column multiplied by 60.
So the final DateTimeTable function will be:
DateTimeTable =
ADDCOLUMNS(
CROSSJOIN(
CALENDAR(DATE(2021,1,1), DATE(2025,12,31)),
GENERATESERIES(0, 23, 1)
),
"DateTime", [Date] + TIME([Value], ROUND(MOD([Value],1)*60,0), 0),
"DateAsInteger", FORMAT([Date], "YYYYMMDD"),
"Year", YEAR([Date]),
"QuarterOfYear", "Q" & FORMAT([Date], "Q"),
"MonthOfYear", FORMAT([Date], "MMMM"),
"MonthNumber", MONTH([Date]),
"DayOfMonth", DAY([Date]),
"DayOfWeek", FORMAT([Date], "dddd"),
"WeekNumber", WEEKNUM([Date])
)
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 |
---|---|
96 | |
95 | |
82 | |
71 | |
64 |
User | Count |
---|---|
115 | |
105 | |
95 | |
79 | |
72 |