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.
My initial tought was "Oh, the same way we have:
'Table'[Column].[Date]
to compare only 2 dates from columns, we probably have:
'Table'[Column].Time
"
But we dont, then i thought
I can use "Hour('Table'[Column])" to compare, but nonono, i cant, cuz will only compare the hour, so if an item have the same hours but minutes different it will not make a good comparisson.
I cant change my Time column to a datetime.
I know i can create a new column just to get my time from my datetime column, but i would rather know if there is another way.
Solved! Go to Solution.
Hi @Anonymous ,
You can create a measure as below:
Measure =
var _datetime=FORMAT(MAX('Table'[Datetime]),"mm/dd/yyyy hh:nn:ss")
var _time =FORMAT(CONCATENATE(CONCATENATE(FORMAT(MAX('Table'[Datetime]),"mm/dd/yyyy")," "),FORMAT(MAX('Table'[time]),"hh:nn:ss")),"mm/dd/yyyy hh:nn:ss")
return IF(DATEDIFF(_time,_datetime,HOUR)<=0,"X","Y")
Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.
Hi @Anonymous ,
You can create a measure as below:
Measure =
var _datetime=FORMAT(MAX('Table'[Datetime]),"mm/dd/yyyy hh:nn:ss")
var _time =FORMAT(CONCATENATE(CONCATENATE(FORMAT(MAX('Table'[Datetime]),"mm/dd/yyyy")," "),FORMAT(MAX('Table'[time]),"hh:nn:ss")),"mm/dd/yyyy hh:nn:ss")
return IF(DATEDIFF(_time,_datetime,HOUR)<=0,"X","Y")
Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.
@Anonymous , As new column , one of the two
if('Table'[Datetime].Time <'Table'[Time] ,"X", "Y")
if(time(Hour('Table'[Datetime]),minute('Table'[Datetime]),second('Table'[Datetime]))<'Table'[Time] ,"X", "Y")
@amitchandak , u sure that the "if('Table'[Datetime].Time <'Table'[Time] ,"X", "Y")" works?
Cuz when i use the ".Time" it doesnt work.
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 |
---|---|
115 | |
101 | |
68 | |
68 | |
43 |
User | Count |
---|---|
145 | |
106 | |
105 | |
90 | |
65 |