Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I have a column Hrs Sold (format is decimal number). Each Hrs Sold has a start time and end time (format is Time)
I am trying to count the total Hrs Sold between 8am - 10pm.
I am using the calculated column 8AM-10PM = IF(HOUR(vw_PivotChargesFrontPage[Visits_StartTime]) >= 8 && HOUR(vw_PivotChargesFrontPage[Visits_EndTime] <=21 && MINUTE(vw_PivotChargesFrontPage[Visits_EndTime]) <=59),TRUE(),FALSE())
but getting False for everything.
Solved! Go to Solution.
I think you should use measure instead - unless you want the nr of hours sold repeated for every hour in a day
this syntax should work for a measure:
8AM-10PM = CALCULATE( SUM(vw_PivotChargesFrontPage[Hrs Sold]), vw_PivotChargesFrontPage[Visits_StartTime]>=TIME(8,0,0), vw_PivotChargesFrontPage[Visits_EndTime]<=TIME(22,0,0) )
alternatively you can just show sum of hours sold and filter the time range you need in the visual
I think you should use measure instead - unless you want the nr of hours sold repeated for every hour in a day
this syntax should work for a measure:
8AM-10PM = CALCULATE( SUM(vw_PivotChargesFrontPage[Hrs Sold]), vw_PivotChargesFrontPage[Visits_StartTime]>=TIME(8,0,0), vw_PivotChargesFrontPage[Visits_EndTime]<=TIME(22,0,0) )
alternatively you can just show sum of hours sold and filter the time range you need in the visual
Yeah, that does the job. Thanks for your help.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
120 | |
101 | |
71 | |
61 |