Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Expert
I cannot see the error here in terms of what i am doing wrong when writing the following DAX.
DAX
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 __table1 = FILTER(__table,[__Index]>EARLIER([__Index])&&[CountComplaints]>EARLIER([CountComplaints])) VAR __count = COUNTROWS(__table1) RETURN IF(ISBLANK(__count),0,__count)
Error Message
Solved! Go to Solution.
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)
Hi Experts
Cannot see the wood for the trees on what i am doing wrong with the following DAX (variable formula).
Concordant = VAR ComplaintsByFiscalMo = ADDCOLUMNS(VALUES(PMS_COMPLAINT[FISCAL_MON_START_DT]),"CountComplaints", CALCULATE(COUNTROWS(PMS_COMPLAINT))) VAR __table = GROUPBY(ComplaintsByFiscalMo,"Index",RANKX(CURRENTGROUP(),[FISCAL_MON_START_DT],,,Dense)) VAR __table1 = FILTER(__table,[Index]>EARLIER([Index])&&[CountComplaints]>EARLIER([CountComplaints])) VAR __count = COUNTROWS(__table1) RETURN IF(ISBLANK(__count),0,__count)
Hi,
Same question here, please refer to https://community.powerbi.com/t5/Desktop/DAX-formula-error-when-using-Addcolumn-and-Groupby/td-p/764...
What's the error you are getting? I'm going to guess that the issue is your use of EARLIER. EARLIER references the previous context, which doesnt look like you have one, but just a guess w/o knowing the error and seeing the data.
Nick_M
That is correct. Earlier , earlier...as mentioned in your reply.
you need to tell earlier what to reference. Can try wrapping an ALL around the table and see if that would work. But would be easier if you can upload some sample data with the required output.
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/
hang fire uploading sample data and required output.
if i add ALL before filter i getting the following error.
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)
many thanks -Dina
excellent feedback as always much appreciated.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |