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
OlafA69
Frequent Visitor

Stacked area chart with grouped and single projects on top

Hi all,

I have a special issue that I'm not able to solve, thus I hope you can help me with this issue. 

I want to have an area chart where I sum up some projects from a slicer, in this case project 1, 2, and 3 but I want the rest of the projects that are existing in the slicer to be stacked individuelly on top. I think the picture that I have attached explains it better. Any help is appreciated. Many thanks in advance.

 Stacked area chart.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @OlafA69 ,

 

Thank you for your feedback. Below are some improvements:
(1) Here is my test data.

vtangjiemsft_0-1737452284841.png

(2) Create two tables.

 

Table 2 = UNION(VALUES('Table'[Project]),{"Other"})
Table 3 = SUMMARIZE('Table','Table'[Project])

 

(3) Create measures.

 

MEASURE =
VAR a =
    VALUES ( 'Table 3'[Project] )
VAR b =
    EXCEPT ( VALUES ( 'Table 2'[Project] ), a )
RETURN
    IF (
        SELECTEDVALUE ( 'Table 2'[Project] ) = "Other",
        CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Project] IN a ) ),
        CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', [Project] IN b ) )
    )
Measure 2 =
IF (
    MAX ( 'Table 2'[Project] ) = "Other",
    CONCATENATEX ( 'Table 3', [Project], "&" ),
    MAX ( 'Table 2'[Project] )
)

 

vtangjiemsft_1-1737452502074.png

vtangjiemsft_2-1737452576324.png

Best Regards,

Neeko Tang

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

5 REPLIES 5
Anonymous
Not applicable

Hi @OlafA69 ,

 

(1) We can create a calculated column.

Legend = SWITCH([Project],
"project1" ,"Mobile",
"project2" ,"Mobile",
"project3" ,"Mobile",
"project4","TV",
"project5" ,"Battery",
"project6" ,"Charger",
"project7" ,"Cable")

vtangjiemsft_0-1737340321762.png

(2) Then the result is as follows.

vtangjiemsft_1-1737340681325.png

 

Best Regards,

Neeko Tang

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

Hello v-tangjie-msft,

thanks for your feedback. You solution is good but what I would like to do is to select 4 or 3 or 6 projects of my choice from a slicer which need to be grouped on the bottom of the stacked area chart. All the other projects in the slicer need to be individually stacked on top of the grouped one. 

Anonymous
Not applicable

Hi @OlafA69 ,

 

Thank you for your feedback. Below are some improvements:
(1) Here is my test data.

vtangjiemsft_0-1737452284841.png

(2) Create two tables.

 

Table 2 = UNION(VALUES('Table'[Project]),{"Other"})
Table 3 = SUMMARIZE('Table','Table'[Project])

 

(3) Create measures.

 

MEASURE =
VAR a =
    VALUES ( 'Table 3'[Project] )
VAR b =
    EXCEPT ( VALUES ( 'Table 2'[Project] ), a )
RETURN
    IF (
        SELECTEDVALUE ( 'Table 2'[Project] ) = "Other",
        CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Project] IN a ) ),
        CALCULATE ( SUM ( 'Table'[Value] ), FILTER ( 'Table', [Project] IN b ) )
    )
Measure 2 =
IF (
    MAX ( 'Table 2'[Project] ) = "Other",
    CONCATENATEX ( 'Table 3', [Project], "&" ),
    MAX ( 'Table 2'[Project] )
)

 

vtangjiemsft_1-1737452502074.png

vtangjiemsft_2-1737452576324.png

Best Regards,

Neeko Tang

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

Hello v-tangjie,

thanks you for your great support. It works well. One question, how can I make sure that the projects I select are always at the bottom of the chart, and all non-selected projects are on top of those?

Thanks

Olaf

Bibiano_Geraldo
Super User
Super User

Hi @OlafA69 ,

Can you share a sample file or data with no sensitive content? you can upload the file in cloud such or onedrive or other and place the link here for download.

 

 

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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