Forum Discussion
Why no Total value shown in the matrix?
Hi, I wrote a measure to decide when selecting slicer Category, which Store_eng and Sub-Category should appear.
Here you can see, when selecting slicer Category=Skincare, the Total values appear.
However, when selecting Category=Makeup, Total values do not show. Why is it like this??
Thanks a lot for your time.
YunJ , Measure get recalculated for Grand total. In case if the condition will be checked for Grand total and will be false. In case of filter, the data is getting removed from scope and Grand total is calculated on that. So you will have the correct total. But there are expectations when calculation use row context to get value. In that case again we need to use summarize or Values to force a row context and sum/avg from there
Like in this example group is forced as row context. there can be one than one
sumx(summarize(table,table[group],"_1",[SuperAveage]),[_1])
sumx(summarize(table,table[group],table[group1],"_1",[SuperAveage]),[_1])
5 Replies
- v-juanli-msft
Community Support
Hi YunJ
Is this problem sloved?If it is sloved, could you kindly accept it as a solution to close this case and help the other members find it more quickly?If not, please feel free to let me know.Best RegardsMaggie - amitchandak
Super User
YunJ , Instead of if try to use the filter. Otherwise force row context using values or summarize .
- YunJ
Post Prodigy
Hi amitchandak May I ask how to avoid using IF?
- YunJ
Post Prodigy
Hi amitchandak I tried to use FILTER like the following, but the Sub-category in the visual seems like more than what I wrote in the measure.
- amitchandak
Super User
YunJ , Measure get recalculated for Grand total. In case if the condition will be checked for Grand total and will be false. In case of filter, the data is getting removed from scope and Grand total is calculated on that. So you will have the correct total. But there are expectations when calculation use row context to get value. In that case again we need to use summarize or Values to force a row context and sum/avg from there
Like in this example group is forced as row context. there can be one than one
sumx(summarize(table,table[group],"_1",[SuperAveage]),[_1])
sumx(summarize(table,table[group],table[group1],"_1",[SuperAveage]),[_1])