Forum Discussion
Problem With Countrows Function
- 9 years ago
I just used your formula in a measure (and not a calculated column), and then used it on our sample data. It seems to give the right results.
cntrows = CALCULATE(COUNTROWS(Table1), FILTER(Table1, Table1[Role]="Primary")) & " P " & CALCULATE(COUNTROWS(Table1), FILTER(Table1, Table1[Role]="Backup")) & " B"
It would be easier for us to help you if you give sample data (like you gave), and then show exactly what the results should be with the sample data. Feel free to change the sample data but make sure that you show what the end results also need to be, so that we can replicate it in Power BI
I'm trying to make it so I can show Both on a single table
I censored the table I am trying to create. The Associate is the name, and the role is relative to the Borough of New York City.
The formula I used for this is CALCULATE(COUNTROWS(FILTER('Contact role','Contact role'[Level]="Primary")))&" (P) "&CALCULATE(COUNTROWS(FILTER('Contact role','Contact role'[Level]="Backup")))&" (B) "
I just used your formula in a measure (and not a calculated column), and then used it on our sample data. It seems to give the right results.
cntrows = CALCULATE(COUNTROWS(Table1), FILTER(Table1, Table1[Role]="Primary")) & " P " & CALCULATE(COUNTROWS(Table1), FILTER(Table1, Table1[Role]="Backup")) & " B"
It would be easier for us to help you if you give sample data (like you gave), and then show exactly what the results should be with the sample data. Feel free to change the sample data but make sure that you show what the end results also need to be, so that we can replicate it in Power BI
- skiely9 years agoFrequent Visitor
That solved my problem, thank you so much I can't believe it was that simple.
I'm sorry I couldn't provide the data, it was confidental (if you couldn't tell by my bad attempt to censor ha)
Thanks