Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

To Summarize table to display into stacked chart

Hi ,

I have been struggling ....I have my data with sum of total for all the stages : 

1) Current Spend

2) Project

3) Budget

and I hope to stack by region (2nd image) and , i could do it in excel... but in powerBi, I have been struggling as i am still not used to DAX language... I read on Summarized, but keep getting errors on the DAX codes... thus, hope to get advise from the forum.

 

Looking forward to your kind advise, Thanks, Val 

 

valWork_0-1720954617290.png

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Anonymous ,

If your table data looks like this.I don't think there is any need to add Qtr.

vzhouwenmsft_0-1721014112930.png

All you need to do is add the field to the visual and it will filter the data accordingly.

vzhouwenmsft_1-1721014205243.png

 

Best Regards,
Wenbin Zhou

View solution in original post

Anonymous
Not applicable

Dear @Wenbin Zhou,

 

it's works for one of my data models 🙂

I shall look into my other to see where could go wrong then. Many thanks for your kind help, the extremely helpful tips, great enlightenment for me.

 

Cheers, Val 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

If I understand it wrong, please provide simple data.

 

Regarding your question, if your data is similar to what I assume, I don't think you need to use the 'Summarize' function, you can just use the 'Sum' function directly.

vzhouwenmsft_0-1721007700312.png

Please follow these steps:

1.Manually enter the following data.

vzhouwenmsft_1-1721008026730.png

2.Put these two fields into the visual as the x-axis(It is normal to display an error because there is no relationship between the two tables)

vzhouwenmsft_3-1721008940612.png

3.Use the 'Selectedvalue' function to determine which stage to calculate.

SELECTEDVALUE function - DAX | Microsoft Learn

Measure = 
var _whichstages = SELECTEDVALUE('Table 2'[Total])
RETURN 
SWITCH(TRUE(),
_whichstages = "Current Spend Amt",SUM('Table'[Current Spend]),
_whichstages = "total Projected",SUM('Table'[Projected])
_whichstages = "total Budget Amt",SUM('Table'[Budget]) 
)

4.Final output

vzhouwenmsft_4-1721008971650.png

 

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

Anonymous
Not applicable

Dear WenBin,

 

Just for the nice idea, using the selectedValue, I manage to come close to the result, however, my result X-axis currently display ...Does that means I need to add Qtr into my dummy table - Table 2?

Q1 Current Spend Amt

Q1 tota Projected

Q1 Total Budget Amt

instead of having the Q1 Grouped.... maybe due to my dataset not in Row format.... Thank you so much again for your kind advise.

valWork_0-1721012647763.png

 

 

QuarterRegionCurrent SpendProjectedBudget
Q1APAC90001000012000
Q1EUROPE290003100035000
Q1US260002900027000
Q1LATIN400040004000
Q2APAC130001300015000
Q2EUROPE350003800037000
Q2US220002500022000
Q2LATIN400050004000
Q3APAC130001900014000
Q3EUROPE330004200036000
Q3US280003900026000
Q3LATIN7000130007000
Q4APAC130003000017000
Q4EUROPE350005400040000
Q4US290005700032000
Q4LATIN7000210007000
Anonymous
Not applicable

Hi @Anonymous ,

If your table data looks like this.I don't think there is any need to add Qtr.

vzhouwenmsft_0-1721014112930.png

All you need to do is add the field to the visual and it will filter the data accordingly.

vzhouwenmsft_1-1721014205243.png

 

Best Regards,
Wenbin Zhou

Anonymous
Not applicable

Dear @Wenbin Zhou,

 

it's works for one of my data models 🙂

I shall look into my other to see where could go wrong then. Many thanks for your kind help, the extremely helpful tips, great enlightenment for me.

 

Cheers, Val 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors