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
mrothschild
Continued Contributor
Continued Contributor

Stacked column/bar chart with non-cumulative percentages

I have a data table which has Project A, B, and C.  Within each project are a set of assets with a Cost associated as well as % returns.  Example table is below.  I have set up a stacked bar chart, which shows the WAVG of each Project (as summarized at the bottom of the table).  In a separate Treemap, if I click on the Asset number, it shows the Return specific to that Asset.  Is there a way to get the "Details" that's available in a Treemap into the Bar Chart show it shows the build-up to the weighted average?  Said differently, is there a way to set up a stacked chart so that it totals the WAVG, but I can click on individual assets that are part of the project and have it display the associated return at the Asset level rather than at the project level?

 

 

Project AssetCostReturn
A17218%
A25124%
A39915%
B49017%
B56519%
B67010%
B75319%
C88829%
C95422%
    
WAVG A  18.04%
WAVG B  15.28%
WAVG C  26.34%
1 ACCEPTED SOLUTION

Hi @mrothschild,

 

Please add below measure to column chart.

WAVG =
VAR tempTable =
    ADDCOLUMNS (
        Table_1,
        "Weighted average", Table_1[Cost]
            / CALCULATE ( SUM ( Table_1[Cost] ), ALLEXCEPT ( Table_1, Table_1[Project ] ) ) * Table_1[Return]
    )
RETURN
    IF (
        ISFILTERED ( Table_1[Asset] ),
        SUM ( Table_1[Return] ),
        SUMX ( tempTable, [Weighted average] )
    )

1.PNG2.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

4 REPLIES 4
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @mrothschild,

 

What is the calculation rule to get the weighted average for each project? What is the correct result when clicking on a specific Asset on Treemap, for example, if I click Asset 2 of ProjectA?

 

Regards,

Yuliana Gu

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

For a specific asset within a project, the return would be specifc to that asset, thus in your question, the result would be 24%.

 

 

Hi @mrothschild,

 

Please add below measure to column chart.

WAVG =
VAR tempTable =
    ADDCOLUMNS (
        Table_1,
        "Weighted average", Table_1[Cost]
            / CALCULATE ( SUM ( Table_1[Cost] ), ALLEXCEPT ( Table_1, Table_1[Project ] ) ) * Table_1[Return]
    )
RETURN
    IF (
        ISFILTERED ( Table_1[Asset] ),
        SUM ( Table_1[Return] ),
        SUMX ( tempTable, [Weighted average] )
    )

1.PNG2.PNG

Best regards,

Yuliana Gu

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

THanks very much!

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.