Forum Discussion
I NEED HELP TO COUNT ROWS FOR A PARTICULAR CONSOLIDATED YEAR CATEGORY
THERE TRHEE TRANSACTIONS UNDER THIS COLUMN
There are 3 transactions under this column which are renew policy, new business, and cancellation. I need help to countrows for renew policy or new business and write the measure for 2023 & 2024. Thank you!!
Woops - sorry - I missed the part where you mentioned the years. The below will give you the row count for renew or new and the years of 2023 and 2024.
FilteredRowCount := CALCULATE( [Row Count], 'YourTable'[Transaction] IN { "Renew policy", "New business" }, YEAR('YourTable'[Date]) IN {2023, 2024} )
3 Replies
- audreygerred
Super User
Hello! First, you can create a measure for total rows:
Row Count = COUNTROWS([YourTable])
COUNTROWS function (DAX) - DAX | Microsoft Learn
Then, you can click the three dots on that measure and click New quick measure. Select Filtered value from the dropdown in the quick measure pane, add in your transaction field and select Renew Policy, then click add. Then, change Renew Policy to New Business and select add again.
The DAX will be like this:
Row Count for Renew Policy =CALCULATE([Row Count], 'YourTable'[Transaction] IN { "Renew policy" }) - Newkidonblock22Regular Visitor
Thank you. I already established that. The problem I am having is how do I filter for different years as I am working on a consolidated report
- audreygerred
Super User
Woops - sorry - I missed the part where you mentioned the years. The below will give you the row count for renew or new and the years of 2023 and 2024.
FilteredRowCount := CALCULATE( [Row Count], 'YourTable'[Transaction] IN { "Renew policy", "New business" }, YEAR('YourTable'[Date]) IN {2023, 2024} )