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 @Vieiraguilherme ,
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 @Vieiraguilherme ,
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.
@Vieiraguilherme , 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")
Proud to be a Super User!
@amitchandak , u sure that the "if('Table'[Datetime].Time <'Table'[Time] ,"X", "Y")" works?
Cuz when i use the ".Time" it doesnt work.
User | Count |
---|---|
357 | |
129 | |
86 | |
83 | |
54 |
User | Count |
---|---|
408 | |
215 | |
126 | |
116 | |
112 |