Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I am new with PowerBI and not familiar with DAX... I would like to do a simple calculation using the data from one column only.
The column reports on a laboratory participation to a training and on the success (or not) at this training:
0 = the lab did not participate to the training
1 = the lab participated to the training but did not pass the test
2 = the lab participated to the training and pass the test
I would like to get the proportion of lab that pass the test:
= "number of lab that participated to the training and pass the test" / "total number of lab that participated to the training")
= total number of "2" / total number of "1" + "2"
Can someone help?
Many thanks!
Solved! Go to Solution.
If you data looks like the matrix, then your results would look like the cards.
I'd do a measure for each result and then put them together to get the Pass Proportion
0 NoParticipate = CALCULATE(count(Sheet1[Lab Name]),Sheet1[Result] =0) 1 ParticipateNoPass = CALCULATE(count(Sheet1[Lab Name]),Sheet1[Result] =1) 2 ParticipatePass = CALCULATE(count(Sheet1[Lab Name]),Sheet1[Result] =2)
Pass Proportion = Divide([2 ParticipatePass],([1 ParticipateNoPass]+[2 ParticipatePass]),0)
If you data looks like the matrix, then your results would look like the cards.
I'd do a measure for each result and then put them together to get the Pass Proportion
0 NoParticipate = CALCULATE(count(Sheet1[Lab Name]),Sheet1[Result] =0) 1 ParticipateNoPass = CALCULATE(count(Sheet1[Lab Name]),Sheet1[Result] =1) 2 ParticipatePass = CALCULATE(count(Sheet1[Lab Name]),Sheet1[Result] =2)
Pass Proportion = Divide([2 ParticipatePass],([1 ParticipateNoPass]+[2 ParticipatePass]),0)