Forum Discussion

rmocca's avatar
rmocca
Icon for Helper I rankHelper I
5 years ago
Solved

Matrix Totals error

Hi again, I'm dealing with this problem, and I've read almost every I can found, but without any luck.   I have a this measures: CPK: Gets an number value according with a lot of data points.   ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi rmocca 

    Use a summarize table is a good way to solve this problem.

    Your new measure:

     

    CPK1 = if(hasonevalue(TAGVALUE[DateValue]),[CPKCategory1],sumx(TAGVALUE,values(TAGVALUE[DateValue])))

     

    In addition to jaideepnema , it seems that values function will return to distinct values in your Datevalue column.

    They may be Date Type or Text, so your meausres will return to an error.

    Build a new measure based on Measure CPKCategory.

    New Measure is like:

     

    IF(HASONEVALUE(Table[Month]),[CPKCategory],Sumx(Table,[CPKCategory]))

     

    By HASONEVALUE, Table[Month] should be the column in your matrix column field. If you use date hierachy, you can add an calcualted column by Month function. Then use these month in matrix column field. So all month will return to the result of [CPKCategory1], and Matrix Total is not in Month so it return to the false result. Due to I don't know your data model, you may update Sumx(Table,[CPKCategory]) in your measure. It should be a measure to calculate the total for all month directly.  In your sample it should be 6+5+3+8 = 22.

     

    Best Regards,

    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.