Forum Discussion
nicholas_goodye
9 months agoFrequent Visitor
Ordering Detail Level Table by Total Count of Rows per Location
The data: LocationTable LocationID LocationName 001 A 002 B 003 C IncidentTable LocationID IncidentID Date 003 1 10/1/25 003 2 7/1/25 003 ...
- 9 months ago
Hello nicholas_goodye ,
I tested the function bellow and worked here;CountOfIncidents_LastMonth = VAR StartOfLastMonth = EDATE(DATE(YEAR(TODAY()), MONTH(TODAY()), 1), -1) VAR StartOfThisMonth = DATE(YEAR(TODAY()), MONTH(TODAY()), 1) RETURN CALCULATE( COUNTROWS('IncidentTable'), 'IncidentTable'[Date] >= StartOfLastMonth, 'IncidentTable'[Date] < StartOfThisMonth )
✅ If this answer solves your problem, please mark it as correct to help other community members.
Zanqueta
Super User
9 months agoHello nicholas_goodye ,
I tested the function bellow and worked here;
CountOfIncidents_LastMonth =
VAR StartOfLastMonth = EDATE(DATE(YEAR(TODAY()), MONTH(TODAY()), 1), -1)
VAR StartOfThisMonth = DATE(YEAR(TODAY()), MONTH(TODAY()), 1)
RETURN
CALCULATE(
COUNTROWS('IncidentTable'),
'IncidentTable'[Date] >= StartOfLastMonth,
'IncidentTable'[Date] < StartOfThisMonth
)
✅ If this answer solves your problem, please mark it as correct to help other community members.