Forum Discussion
chrisgehm
8 years agoHelper III
Accumulated count if
Hi everyone! I'm having some troubles while calculating some values. I was doing it in excel with dynamic tables, but now I want to make a step forward and start using Power BI :) I have thi...
- 8 years ago
Hi, you can try to obtain your result with this:
Count to Cond1 is 0 and Cond2 Open and Cond3 is A = COUNTROWS ( FILTER ( Table1, Table1[Cond1] = 0 && Table1[Cond2] = "Open" && Table1[Cond3] = "A" ) )Count to Cond1 is 0 and Cond2 Open = COUNTROWS ( FILTER ( Table1, Table1[Cond1] = 0 && Table1[Cond2] = "Open" ) )
Result = DIVIDE ( [Count to Cond1 is 0 and Cond2 Open and Cond3 is A], [Count to Cond1 is 0 and Cond2 Open], BLANK () )With 3 measure or All together in a single Measure
Measure = VAR Count_to_Cond1_is_0_and_Cond2_Open_and_Cond3_is_A = COUNTROWS ( FILTER ( Table1, Table1[Cond1] = 0 && Table1[Cond2] = "Open" && Table1[Cond3] = "A" ) ) VAR Count_to_Cond1_is_0_and_Cond2_Open = COUNTROWS ( FILTER ( Table1, Table1[Cond1] = 0 && Table1[Cond2] = "Open" ) ) RETURN DIVIDE ( Count_to_Cond1_is_0_and_Cond2_Open_and_Cond3_is_A, Count_to_Cond1_is_0_and_Cond2_Open, BLANK () )Regards
Victor
Lima - Peru
Vvelarde
8 years agoCommunity Champion
Hi, you can try to obtain your result with this:
Count to Cond1 is 0 and Cond2 Open and Cond3 is A =
COUNTROWS (
FILTER (
Table1,
Table1[Cond1] = 0
&& Table1[Cond2] = "Open"
&& Table1[Cond3] = "A"
)
)Count to Cond1 is 0 and Cond2 Open = COUNTROWS ( FILTER ( Table1, Table1[Cond1] = 0 && Table1[Cond2] = "Open" ) )
Result =
DIVIDE (
[Count to Cond1 is 0 and Cond2 Open and Cond3 is A],
[Count to Cond1 is 0 and Cond2 Open],
BLANK ()
)With 3 measure or All together in a single Measure
Measure =
VAR Count_to_Cond1_is_0_and_Cond2_Open_and_Cond3_is_A =
COUNTROWS (
FILTER (
Table1,
Table1[Cond1] = 0
&& Table1[Cond2] = "Open"
&& Table1[Cond3] = "A"
)
)
VAR Count_to_Cond1_is_0_and_Cond2_Open =
COUNTROWS ( FILTER ( Table1, Table1[Cond1] = 0 && Table1[Cond2] = "Open" ) )
RETURN
DIVIDE (
Count_to_Cond1_is_0_and_Cond2_Open_and_Cond3_is_A,
Count_to_Cond1_is_0_and_Cond2_Open,
BLANK ()
)
Regards
Victor
Lima - Peru