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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.