Forum Discussion
Relationship issue with Measure
- 6 years ago
New Table
My Table = VAR OuterComplaints = COUNTROWS ( PMS_COMPLAINT ) RETURN ADDCOLUMNS ( VALUES ( PMS_FINANCIAL_PDS[Month Start] ), "CountComplaints", CALCULATE ( COUNTROWS ( PMS_COMPLAINT ) ), "Index", RANKX ( PMS_FINANCIAL_PDS, PMS_FINANCIAL_PDS[Month Start],,, DENSE ), "Outer Complaints", OuterComplaints )Something along these lines...
based on your excellent feedback, if you take from PMS_TM1_Sales_vol Table column (month_date) and add that to the table it give you the right p-value but errors on the inidivdual data points shows 846 as a constant number for 12 periods.
As opposed to the actual value (see image below) - fixed one problem another one comes along.
Haven't been able to look at this a whole lot the past couple of days. The problem of a wrong value in a total is generally the result of evaluating a measure with no filters. The fix is either to do a SUMX of the measure over the distinct months, or to have an IF statement that evaluates the measure differently if there are no filters.
- Anonymous6 years agoNot applicable
hi Freder1ck
firstly many thanks, i believe the answer lies with the following measure.
__s = VAR Mytable1 = ADDCOLUMNS(VALUES(PMS_FINANCIAL_PDS[Month Start]),"CountComplaints",CALCULATE(COUNTROWS(PMS_COMPLAINT)),"Index",RANKX(PMS_FINANCIAL_PDS,PMS_FINANCIAL_PDS[Month Start],,,Dense)) RETURN SUMX(Mytable1, SUMX(Mytable1, IF([Index]>EARLIER([Index])&&[CountComplaints]<EARLIER([CountComplaints]), 1, IF([Index]>EARLIER([Index])&&[CountComplaints]>EARLIER([CountComplaints]), -1)) ) ) - Anonymous6 years agoNot applicable
Another expert also tried
I've just tried to see what values EARLIER formula returns, and it seems like it returns the same value as if there were no EARLIER function.
I created the measure below to check the output:
__testS = VAR Mytable1 = ADDCOLUMNS(VALUES(PMS_FINANCIAL_PDS[Month Start]);"CountComplaints";CALCULATE(COUNTROWS(PMS_COMPLAINT));"Index";RANKX(PMS_FINANCIAL_PDS;PMS_FINANCIAL_PDS[Month Start];;;Dense)) VAR cc = SUMX(Mytable1; SUMX(Mytable1; EARLIER([CountComplaints]) ) ) VAR i = SUMX(Mytable1; SUMX(Mytable1; EARLIER([Index]) ) ) RETURN i & ", " & cc- freder1ck6 years agoKudo KingpinInstead of EARLIER, you could set variables to fix values outside the SUMX. You could also preview the results of your MyTable by doing a new table from the modeling tab. You could also use ADDCOLUMNS to preview the amounts at the row level.
- Anonymous6 years agoNot applicable
hi freder1ck
could you kindly demo this table - i follow what you are saying but slighly confused at the start. i'll happily add a demo file if you need one. thanks once again.