Forum Discussion
nayan28apr
Helper I
5 years agoHow to use Summarize for multiple columns in different metrix to show correct row subtotal
Hi, I have four columns in my table. Region, Cluster, Franchise, Segment Below measure work fine when i use region in metric graph and it gives correct row subtotal. Measure= VAR summar...
- 5 years ago
Thanks for your inputs.
Thank you very much. Measure= VAR summarytable = SUMMARIZE('Table',[Segment],[Franchise],[Cluster],[weekno],"_value",[Sales]) Return SUMX(summarytable ,[__value]) This formula finally worked for me, I need to use all columns in summarize. I have than used AddColumns with Summarize to find best performance out of it as Summarize was giving me performance issues. Measure= VAR summarytable = AddColumns(SUMMARIZE('Table',[Segment],[Franchise],[Cluster],[weekno]),"_value",[Sales]) Return SUMX(summarytable ,[__value])
v-kelly-msft
Community Support
5 years agoHi nayan28apr ,
Modify your measure as below:
Measure=
VAR summarytable = SUMMARIZE('Table',[weekno],"_value",[Sales])
Return
IF(HASONEVALUE(Table[weekno]), [Sales], SUMX(summarytable ,[__value]))
And you will see:
Check my sample .pbix file attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
- nayan28apr5 years ago
Helper I
Thanks for your inputs.
Thank you very much. Measure= VAR summarytable = SUMMARIZE('Table',[Segment],[Franchise],[Cluster],[weekno],"_value",[Sales]) Return SUMX(summarytable ,[__value]) This formula finally worked for me, I need to use all columns in summarize. I have than used AddColumns with Summarize to find best performance out of it as Summarize was giving me performance issues. Measure= VAR summarytable = AddColumns(SUMMARIZE('Table',[Segment],[Franchise],[Cluster],[weekno]),"_value",[Sales]) Return SUMX(summarytable ,[__value])