Forum Discussion
Conditional column based on data from different rows and same user
- 2 years ago
Thanks lbendlin
Thanks LeandroDeodato , the DAX might be easier to implement, I tested it and it works!
but, if I have anather coloumn (ex: number of test 2), and want to do the same aggregation as the one I have done to : "number of test" , what is the correct DAX fonction to use ?
I added an extra line (Pass2) of the other coloumn but I am getting error : The syntax for '"Pass 2"' is incorrect.
New_Table = SUMMARIZE('exam (Questions)',
'exam (Questions)'[username],
"Number of Tests", COUNT('exam (Questions)'[ID]),
"Pass", if(CONTAINS('exam (Questions)','exam (Questions)'[Pass(Y/N)],"Yes"),"Yes","No")
"Pass2", if(CONTAINS('exam (Questions)','exam (Questions)'[Pass(Y/N)2],"Yes"),"Yes","No")
)
Thanks
- muhammad_786_12 years agoSolution Supplier
There's only 1 comma missing between "Pass" and "Pass2" lines, which causes a syntax issue.
It should be like this:
New_Table = SUMMARIZE('exam (Questions)',
'exam (Questions)'[username],
"Number of Tests", COUNT('exam (Questions)'[ID]),
"Pass", if(CONTAINS('exam (Questions)','exam (Questions)'[Pass(Y/N)],"Yes"),"Yes","No"),
"Pass2", if(CONTAINS('exam (Questions)','exam (Questions)'[Pass(Y/N)2],"Yes"),"Yes","No")
)Best Regards,
Muhammad Yousaf