Forum Discussion
rgalvez
5 years agoFrequent Visitor
New column counting values from two different tables
Hello, This is my fitst post, I hope I can get the help I need. This is my case: I have Table Enrollments linked to Quiz and to Excersise. Type A or B define whether the user did a Quiz (A) or a...
- 5 years ago
Hi rgalvez ,
You can create the following calculated column:
Attempts = SWITCH(Enrollments[Type],"A",CALCULATE(COUNTROWS(Quiz),FILTER(Quiz,Quiz[UserID] = EARLIER(Enrollments[UserID]))),"B",CALCULATE(COUNTROWS(Excersise),FILTER(Excersise,Excersise[UserID] = EARLIER(Enrollments[UserID]))))+0If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
v-deddai1-msft
Community Support
5 years agoHi rgalvez ,
You can create the following calculated column:
Attempts = SWITCH(Enrollments[Type],"A",CALCULATE(COUNTROWS(Quiz),FILTER(Quiz,Quiz[UserID] = EARLIER(Enrollments[UserID]))),"B",CALCULATE(COUNTROWS(Excersise),FILTER(Excersise,Excersise[UserID] = EARLIER(Enrollments[UserID]))))+0
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
- rgalvez5 years agoFrequent Visitor
It worked! Thanks a lot!