Forum Discussion
CJ_96601
6 years agoHelper V
Measure - If then else
Can someone help me to calculate each record with F as 2 count and M as one count, please refer below. Record F F F ...
- 6 years ago
Hi CJ_96601 ,
I have crate an index column first in query editors to count conveniently.
Then you can create a measure like this:
Total count = CALCULATE ( COUNT ( 'Table'[Record] ), FILTER ( 'Table', 'Table'[Record] = "F" ) ) * 2 + CALCULATE ( COUNT ( 'Table'[Record] ), FILTER ( 'Table', 'Table'[Record] = "M" ) )You will get the result:
Here is the demo, please try it:
Best Regards,
Yingjie LiIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
v-yingjl
6 years agoCommunity Support
Hi CJ_96601 ,
I have crate an index column first in query editors to count conveniently.
Then you can create a measure like this:
Total count =
CALCULATE (
COUNT ( 'Table'[Record] ),
FILTER ( 'Table', 'Table'[Record] = "F" )
) * 2
+ CALCULATE (
COUNT ( 'Table'[Record] ),
FILTER ( 'Table', 'Table'[Record] = "M" )
)You will get the result:
Here is the demo, please try it:
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
CJ_96601
6 years agoHelper V
Thanks. it works as per my requirements