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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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