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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Create Stacked Column Chart using only measures

I have 3 Tables and created measuers in all these tables, using these measures i want to create a stacked column chart.

But, only using measures i cant create it as i need one dimension column.

Below are the tables and measures i created (example).

 

Sale Stge: Table1

-----------------------

CountrySales_StageAmount K$Month
India1500Jan-19
India2400Jan-19
India3300Jan-19
India4250Jan-19
America1800Jan-19
America2500Jan-19
America3300Jan-19
America4150Jan-19

 

Measures for sale stge:

------------------

Sales1 = CALCULATE(SUM(Sale Stge[Amount K$]),FILTER(ALL(Sale Stge[Sales_Stage]), Sale Stge[Sales_Stage] >=1 && Sale Stge[Sales_Stage2] <=2))    --- Ans. 2200

 

Sales2 = CALCULATE(SUM(Sale Stge[Amount K$]),FILTER(ALL(Sale Stge[Sales_Stage]), Sale Stge[Sales_Stage] >=3 && Sale Stge[Sales_Stage2] <=4))    --- 1000

 

Sales All = SUM(Sale Stge[Amount K$])   --3200

 

 

Sales: Table2

------------------------

CountryAmount K$Month
India200Jan-19
America100Jan-19

 

Measures for Sales:

--------------------------

Sales M= SUM(Sales[Amount K$])

 

 

Budget: Table3

------------------------

CountryAmount K$Month
India600Jan-19
America850Jan-19

 

Measures for Budget:

-----------------------------

Budget = SUM(Budget[Amount K$])

Remaing Budget = Budget - [Sales M]

 

Using all above measures i want to create a table like beow and then create a stacked column chart over it. Also give country as a slicer.

 

Table for Stack Column Chart: ( unable to create like below)

-------------------------------------

Sales infoSales1Sales2Sales AllBudgetSalesRemaing Budget
Sales Stage220010003200   
Budget   14503001150

 

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

For your requirement (only using measures to create the visual as you want), It is impossible in power bi for now.

But you could just adjust your formula as below:

Step1:

Add a Sales info fact table.

(only using measures can't create it as it need one dimension column.)

7.JPG

Step2:

Adjust your formula

Sales1 = IF(SELECTEDVALUE(info[Sales info])="Sales Stage", CALCULATE(SUM('Sale Stge'[Amount K$]),FILTER(ALL('Sale Stge'[Sales_Stage]), 'Sale Stge'[Sales_Stage] >=1 && 'Sale Stge'[Sales_Stage] <=2)))
Sales2 = IF(SELECTEDVALUE(info[Sales info])="Sales Stage",CALCULATE(SUM('Sale Stge'[Amount K$]),FILTER(ALL('Sale Stge'[Sales_Stage]), 'Sale Stge'[Sales_Stage] >=3 && 'Sale Stge'[Sales_Stage] <=4)) )
Sales All = IF(SELECTEDVALUE(info[Sales info])="Sales Stage", SUM('Sale Stge'[Amount K$]))
Sales All = IF(SELECTEDVALUE(info[Sales info])="Sales Stage", SUM('Sale Stge'[Amount K$]))
Budget = IF(SELECTEDVALUE(info[Sales info])="Budget",SUM(Budget[Amount K$]))
Remaing Budget = IF(SELECTEDVALUE(info[Sales info])="Budget", Budget[Budget] - [Sales M])

for Also give country as a slicer.

You could add a country fact table and then create the relationship with these three tables.

8.JPG

Result:

9.JPG

 

and here is pbix file, please try it..

 

Best Regards,
Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

For your requirement (only using measures to create the visual as you want), It is impossible in power bi for now.

But you could just adjust your formula as below:

Step1:

Add a Sales info fact table.

(only using measures can't create it as it need one dimension column.)

7.JPG

Step2:

Adjust your formula

Sales1 = IF(SELECTEDVALUE(info[Sales info])="Sales Stage", CALCULATE(SUM('Sale Stge'[Amount K$]),FILTER(ALL('Sale Stge'[Sales_Stage]), 'Sale Stge'[Sales_Stage] >=1 && 'Sale Stge'[Sales_Stage] <=2)))
Sales2 = IF(SELECTEDVALUE(info[Sales info])="Sales Stage",CALCULATE(SUM('Sale Stge'[Amount K$]),FILTER(ALL('Sale Stge'[Sales_Stage]), 'Sale Stge'[Sales_Stage] >=3 && 'Sale Stge'[Sales_Stage] <=4)) )
Sales All = IF(SELECTEDVALUE(info[Sales info])="Sales Stage", SUM('Sale Stge'[Amount K$]))
Sales All = IF(SELECTEDVALUE(info[Sales info])="Sales Stage", SUM('Sale Stge'[Amount K$]))
Budget = IF(SELECTEDVALUE(info[Sales info])="Budget",SUM(Budget[Amount K$]))
Remaing Budget = IF(SELECTEDVALUE(info[Sales info])="Budget", Budget[Budget] - [Sales M])

for Also give country as a slicer.

You could add a country fact table and then create the relationship with these three tables.

8.JPG

Result:

9.JPG

 

and here is pbix file, please try it..

 

Best Regards,
Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you it worked well!. i was using SELECTEDVALUE only for slicers. But today i learned usage of selectedvalue for tables. Thanks a lot 🙂

Anonymous
Not applicable

Chart should be as below:

 

Stack column chart.PNG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.