Forum Discussion
Multiple operation on matrix cell
HI kpratik,
>>So I am trying to find Chi Square in brute force manner for which I need to do following for each cell of matrix
I don't think it is possible, power bi not contains row index and column index, you can't manually find out specific cell.
>>Wanted to understand if this will be possible in any way in Power BI?
This is possible, but it should be more complicated than you think.
For example, you have to manually calculate with specific filter to achieve what you mentioned, the use if statement with condition to control which place shows these result.
If you can please provide the pbix file with expected result to help us clarify your table structure and coding formula.
Notice: please do mask on sensitive data.
Regards,
Xiaoxin Sheng
Hello Anonymous Thank you for your reply.
I was able to do what I have mentioned in little different way, but some how basic arithmetic calculation done by DAX function is not giving correct value. Let me explain.
I have transformed my matrix (mentioned in the problem) as a table which looks something like this:
Column expcol,powercol,finalexpcol are different measure which I am using and looks like following:
expcol = DIVIDE((cross_tab_file[ROW_TOTAL]*cross_tab_file[COL_TOAL]),cross_tab_file[GRAND_TOTAL]) powercol = POWER(ABS(cross_tab_file[COUNT]-cross_tab_file[expcol]),2) finalexpcol = DIVIDE(cross_tab_file[powercol],cross_tab_file[expcol])
However the calculation which are done by DAX is not matching with actual calculator.
Consider 1st row in the image
expcol should be (40*29)/113 which in calculator gives 10.2654867257 while DAX result is 10.266719118...
Further powercol should be (Mod(9-10.266719118))^2 which again in calculator gives as 1.60457732391 while in DAX returns as 1.18915639..
Again finalexpcol should be 1.18915639/10.266719118 which in calcultor is 0.11582632935 and in DAX is 0.177456..
Am i doing something wrong?? Any pointer would be very helpful.
Thanks
- Anonymous8 years agoNot applicable