Forum Discussion
JMHenriques
2 years agoFrequent Visitor
get working days since datetime until NOW with decimals
Hi all, I have a Calendar Table with IsWeekend and a table with a "created_at" column in Datetime format. I need to count the days and hours passed since the "created_at" until the refresh da...
- Anonymous2 years ago
Hi JMHenriques ,
Thanks to CKN for the idea.
JMHenriques Your Tickets table are being filtered because you're using a slicer about “created_at”. When you select a value in the slicer, Tickets table is filtered. If you want to disable this filtering, you can use the Edit Interaction feature.
Best regards,
Mengmeng Li
CKN
2 years agoFrequent Visitor
Can you use a DATEDIFF(calculating hours) then subtract COUTROWS of ISWEEKEND days*24?
JMHenriques
2 years agoFrequent Visitor
Sort of... I get it working with the following code:
_measure_Age_Days Weekends =
DATEDIFF(MAX(Tickets[created_at]),UTCNOW(),hour)/24 -
COUNTROWS (
FILTER (
ALL ( CalendarTable ),
[Date] >= SELECTEDVALUE (Tickets[created_at])
&& [Date] <= TODAY()
&& [IsWeekend] = "Yes"
)
)
but the measure basically destroys the tables I put it into, making data appear that should have been filtered out by the filters directly in the "page filters". And it also takes like 1 minute to process. Probably in count rows is not the way to go.