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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
mickyg7
New Member

Showing percent of total in stacked column chart instead of count

Hi!

 

New to power bi - I'm wanting to edit the stacked column chart pictured below to do as title says. 

 

For example, the column 3051-3700m is labeled with 27 for Drilling & MIR and 185 for Down. These numbers are calculated measures of number of records for records of these statuses (Drilling & MIR or Down). Instead, I'd like them to be labeled with the perent of total.. so 13% for Drilling & MIR (27/(27+185)) and 87% for Down (185/(27+185)).

 

Thanks!

 

 

 

Screenshot (3).png

1 ACCEPTED SOLUTION
v-haibl-msft
Employee
Employee

@mickyg7

 

In this scenario, you can create another measure to show the percent of total. I assume you have a dataset as below. You can use following formula to create a new measure (Please modify the table and column name according to your actual dataset).

Showing percent of total in stacked column chart instead of count_1.jpg

 

Perent of Total = 
DIVIDE (
    [Total_Amount],
    CALCULATE ( SUM ( Table1[Amount] ), ALLEXCEPT ( Table1, Table1[Range] ) )
)

Showing percent of total in stacked column chart instead of count_2.jpg

 

Best Regards,
Herbert

View solution in original post

8 REPLIES 8
lucacebraak
Regular Visitor

@v-haibl-msft @mickyg7 @andyspa @PedroSimao00 

 

Is it also posible to add the procent and the exact value. 

lucacebraak_0-1637834852095.png

 

I would like to add the percent of the total and the values that are already in the graphic

 

kind regards Luca

 

 

v-haibl-msft
Employee
Employee

@mickyg7

 

In this scenario, you can create another measure to show the percent of total. I assume you have a dataset as below. You can use following formula to create a new measure (Please modify the table and column name according to your actual dataset).

Showing percent of total in stacked column chart instead of count_1.jpg

 

Perent of Total = 
DIVIDE (
    [Total_Amount],
    CALCULATE ( SUM ( Table1[Amount] ), ALLEXCEPT ( Table1, Table1[Range] ) )
)

Showing percent of total in stacked column chart instead of count_2.jpg

 

Best Regards,
Herbert

You Can use 100% chart top right. 

 

Gnewbie_2-1691095698763.png

 

 

In the divide function, how is [Total_amount] the numerator. The numerator for the percentage should be the individual values 

Hi, 

What is supposed to go in "[range]" part of this formula?

ALLEXCEPT ( Table1, Table1[Range] )  

 

Why did you create the formula with "ALLEXCEPT"?

Thanks @v-haibl-msft, I have one question, what is the difference between this solution and the 100% stacked  column?

Beckham
Advocate II
Advocate II

The way I have done this is to create new measures that do the divide separately, and gets the % you are looking for, and then add them as a tooltip. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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