Forum Discussion
Find overdue dates this month
- 1 year ago
Overdue_Flag = IF( AND( YourTable[Complete By] <= EOMONTH(TODAY(), 0), YourTable[Complete By] >= DATE(YEAR(TODAY()), MONTH(TODAY()), 1) ), 1, 0 )Can you please try this as calculated column?
- 1 year ago
This measure is currently counting all records, not just those where DaysOverdueFlag equals 1.
This behavior occurs because the expression myTable[DaysOverdueFlag] = 1 evaluates to a boolean TRUE or FALSE for each row, and COUNTAX counts all non-blank results, including FALSE values.
To count only the rows where DaysOverdueFlag equals 1, you can use the CALCULATE function in combination with the COUNTROWS function and a filter condition:
Overdue Flag = CALCULATE(
COUNTROWS(myTable),
myTable[DaysOverdueFlag] = 1
)
Overdue_Flag =
IF(
AND(
YourTable[Complete By] <= EOMONTH(TODAY(), 0),
YourTable[Complete By] >= DATE(YEAR(TODAY()), MONTH(TODAY()), 1)
),
1,
0
)
Can you please try this as calculated column?
I now realise the mistake I was making with the incorrect column name and your solution does in fact work, happy to make this as a solution. I am now trying to count number of overdue flags with this measure
- anilelmastasi1 year agoSuper User
This measure is currently counting all records, not just those where DaysOverdueFlag equals 1.
This behavior occurs because the expression myTable[DaysOverdueFlag] = 1 evaluates to a boolean TRUE or FALSE for each row, and COUNTAX counts all non-blank results, including FALSE values.
To count only the rows where DaysOverdueFlag equals 1, you can use the CALCULATE function in combination with the COUNTROWS function and a filter condition:
Overdue Flag = CALCULATE(
COUNTROWS(myTable),
myTable[DaysOverdueFlag] = 1
)
- Elisa1121 year agoHelper V
yes that also works
Thanks for all your help much appreciated
- anilelmastasi1 year agoSuper User
You are welcome Elisa112, anytime 🙂