Forum Discussion
DAX formula error when using Addcolumn and Groupby
- 7 years ago
Hi Anonymous ,
Take try of this one:
Concordant = VAR __table = ADDCOLUMNS(VALUES(PMS_COMPLAINT[FISCAL_MON_START_DT]),"CountComplaints", CALCULATE(COUNTROWS(PMS_COMPLAINT)),"__Index",RANKX(PMS_COMPLAINT,PMS_COMPLAINT[FISCAL_MON_START_DT],,,Dense)) VAR __count = CALCULATE(COUNTROWS(__table),FILTER(__table,[__Index]<=MAX([__Index])&&[CountComplaints]<=MAX([CountComplaints]))) RETURN IF(ISBLANK(__count),0,__count)
i am referring to the folloiwing Kendall's Tau Quick Measure here https://community.powerbi.com/t5/Quick-Measures-Gallery/Kendall-s-Tau/m-p/625107
I am trying to re create the same calculation using my dataset. Sample file attached. I am trying to get the tau
The values i would like to use from my data set are Material_id and FISCAL_MON_START_DT as the two variables. Which find these in the main FACT table PMS_Complaints.
The answer lie with the greg decker link on how you can implement the measure....he uses two variables and sorts the data interviewer 1 and 2. I want to implement the same principles with my data using variables as I mentioned in above post...
Smaple Data File
https://www.dropbox.com/s/i0nffe5gso2d684/Sample__.pbix?dl=0
for required output see tau value in image (below)
currently my tau value is 0.186441 as you will see from first tab when you open up pBIX file. i am trying to make this measure dynamic.
A link on how to calculate tau value. https://www.statisticshowto.datasciencecentral.com/kendalls-tau/