Forum Discussion
Matrix column subtotal don't show values
- 5 years ago
Hi rcaeiro,
Try measure as:
Measure = SUMX(VALUES(TableA[CONTRACT_MONTH]),[Stock1])Here is the output:
Best Regards,
Link
You should have a Date table so you don't have to deal with generating your dates inside your measure like that. Please see this link on how to do that.
Creating a simple date table in DAX - SQLBI
Having said that, the SELECTEDVALUE is returning blank in your Total calculation. You can get around that by using your existing measure in a new measure like this.
NewMeasure = SUMX(VALUES(MonthTable[MonthCode]), [Stock])
Pat
- rcaeiro5 years agoNew Member
Hello Pat, thank you for your feedback.
I've converted the "MonthTable" into a Date Table, and calculated the month code that i want.
Now i've the measure like that:
Stock = VAR _month = SELECTEDVALUE(MonthTable[MonthCode1],201801) var _value = SWITCH(True(), FIRSTNONBLANK(QueryA[CONTRACT_MONTH],1) = _month, var _previousmonths = CALCULATETABLE(VALUES(QueryA[CONTRACT_MONTH]), QueryA[CONTRACT_MONTH]<_month) return CALCULATE(sum(QueryA[STOCK]), _previousmonths), FIRSTNONBLANK(QueryA[CONTRACT_MONTH],1) < _month, BLANK(), FIRSTNONBLANK(QueryA[CONTRACT_MONTH],1) > _month, sum(QueryA[STOCK]) ) return _valueAnd a new measure:
Stock2 = SUMX(VALUES(MonthTable[MonthCode1]), [Stock])But the column with total still empty 😞
Do you have any suggestion?
- v-xulin-mstf5 years ago
Community Support
Hi rcaeiro,
I can not reproduce your issue with the screenshot, could you provide sample data?
Best Regards,
Link
- rcaeiro5 years agoNew Member
Hello v-xulin-mstf,
Please find a sample is this link: https://wetransfer.com/downloads/4f663da07cab769c3a4b51762a54893020210215124040/57854fa29fe1ca769bb5ce958119bbdc20210215124059/e56ce0
Thank you!