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!
SabineOussi
Skilled Sharer
10 years agoHello everyone,
I'm a bit confused here.
Doesn't the below calculated measure give the same results regardless of how many environment types you have? That way if you have more than two environments, the percentage will be calculated using only one query rather than one or two for each type.
Environment % =
DIVIDE(COUNTROWS(Table) ,
CALCULATE(
COUNTROWS(Table),
ALL(Table[Environment])
))
You then create a matrix where you put your date as rows, environment as columns, environment summarized as count and the calculated environment % as values.
Does it also work?