Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi guys, I need some help.
I have a measure that takes the hours of a date/time and counts how many IDs had the time greater than 11hs, but this is giving an error.
thank you for the help
Solved! Go to Solution.
Hi @Spotto ,
Please try
Time =
CALCULATE (
COUNT ( 'gdp tb_pagamento_Contrato'[ID_Contrato] ),
FILTER (
'gdp tb_pagamento_Contrato',
TIMEVALUE ( 'gdp tb_pagamento_Contrato'[Data_Liberado_PGTO] )
> TIME ( 11, 0, 0 )
)
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Spotto ,
Please try
Time =
CALCULATE (
COUNT ( 'gdp tb_pagamento_Contrato'[ID_Contrato] ),
FILTER (
'gdp tb_pagamento_Contrato',
TIMEVALUE ( 'gdp tb_pagamento_Contrato'[Data_Liberado_PGTO] )
> TIME ( 11, 0, 0 )
)
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Spotto
in this DAX I can see that in the variable "horas" you found the max value and converted it to a time value. Which gives you a single scalar value that is the maximum value in that column. Then you are comparing it with time(11,00,00) which is also a scalar value.
So you are comparing two fixed scalar values in the filter expression and are not really including any column in the table filter expression in the CALCULATE() function. This is exactly what the error statement is saying
In order to fix this error please include a column from the table in the filter expression.
Hi:
Not sure if this will help.
Assuming you have a srat and finish time, you can caclulate out the difference in hours. If the hours are 11 or more you can add a 1 to column. See below:
Calc Column Measure.
thanks for your answer but I'm making an application with directquery and I can't (as far as I know) change the table structure so I'm doing it by measures.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |