The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
Return
How can i make this one formula genric for other fields like franchise, segment or cluster too?
Need to show correct row subtotal in other metrix graphs.
Solved! Go to Solution.
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])
Hi @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!
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])
@nayan28apr , Calculation groups is one solution.
There is a set of blogs from sqlbi, you can find other links on this blog.
calculation groups
https://www.sqlbi.com/blog/marco/2020/07/15/creating-calculation-groups-in-power-bi-desktop/
User | Count |
---|---|
80 | |
78 | |
37 | |
34 | |
31 |
User | Count |
---|---|
93 | |
81 | |
60 | |
49 | |
49 |