Forum Discussion
bryan_d
10 years agoRegular Visitor
Help with counting
Hi there I can't seem to get this to work - hoping you can help! I have the following columns in a large table extracted from print logs: DateGenerated Time Hour Environment ...
- 10 years ago
Here's the example I created
The result looks like this
Here are the Measures I used
LEGACY # = COUNTROWS(FILTER(Table1, Table1[Environment]="LEGACY")) LEGACY % = DIVIDE([LEGACY #], [TOTAL #], 0) NEW # = COUNTROWS(FILTER(Table1, Table1[Environment]="NEW")) NEW % = DIVIDE([NEW #],[TOTAL #],0) TOTAL # = [LEGACY #] + [NEW #]
Hope this helps!
Sean
10 years agoCommunity Champion
Here's the example I created
The result looks like this
Here are the Measures I used
LEGACY # = COUNTROWS(FILTER(Table1, Table1[Environment]="LEGACY")) LEGACY % = DIVIDE([LEGACY #], [TOTAL #], 0) NEW # = COUNTROWS(FILTER(Table1, Table1[Environment]="NEW")) NEW % = DIVIDE([NEW #],[TOTAL #],0) TOTAL # = [LEGACY #] + [NEW #]
Hope this helps!
MattAllington
10 years agoCommunity Champion
Sorry, yes distinct count only works if you have a unique row identifer. Your countrows formula are the best for your data.