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
irnm8dn
Post Prodigy
Post Prodigy

Percent of Total by Day - (NOT % of Grand Total)

I am trying to calculate the % of Total by Day.

 

In the screen capture below, imagine that I have 3 types of fruit.  Apples, Oranges, and Lemons.  I am trying to figure out how to calculate the percentage of sales for a specific day.

 

Capture.PNG

 

For instance, when you look at the left-most column I would like to label this as:

 

Lemons (Red) 60%

Oranges (Black) 8%

Apples (Blue) 32%

 

I only expect to show the values.

 

Thanks in advance.

 

1 ACCEPTED SOLUTION

Hi @irnm8dn,

 

According to your description above, you want to show percentage(not percentage of grand total) as label on stacked column chart like below, but not like the 100% stacked column chart, right?

 

Stacked.png

 

Currently, there is no option to show percentage(not percentage of grand total) as label on stacked column chart. You can add it as an idea on Power BI Ideas forum to improve Power BI on this feature.

 

An alternative solution is creating a new measure to calculate the percentage, and then show it as tooltips on the chart. Smiley Happy

Measure = 
DIVIDE (
    SUM ( 'Fruit Sample Data Set'[ Units Sold ] ),
    CALCULATE (
        SUM ( 'Fruit Sample Data Set'[ Units Sold ] ),
        ALL ( 'Fruit Sample Data Set'[Fruit] )
    )
)

r3.PNG

 

Regard

View solution in original post

5 REPLIES 5
v-ljerr-msft
Employee
Employee

Hi @irnm8dn,

 

Could you post your table structures with some sample/mock data, and the expected against it? So that we can better assist on this issue. It's better to share a sample pbix file. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading. Smiley Happy

 

Regards

@v-ljerr-msft

 

I have included a sample dataset and a ,pbix file. link

 

As you can see, my axis is using a date hierarchy.  I want to show the percentage of units sold based on Year, Month, Day so that I can at any specific time how much of my sales during that time period are made up of which fruit.

 

I have also included some notes within the .pbix in the text box.

 

Thank you.

Hi @irnm8dn,

 

According to your description above, you want to show percentage(not percentage of grand total) as label on stacked column chart like below, but not like the 100% stacked column chart, right?

 

Stacked.png

 

Currently, there is no option to show percentage(not percentage of grand total) as label on stacked column chart. You can add it as an idea on Power BI Ideas forum to improve Power BI on this feature.

 

An alternative solution is creating a new measure to calculate the percentage, and then show it as tooltips on the chart. Smiley Happy

Measure = 
DIVIDE (
    SUM ( 'Fruit Sample Data Set'[ Units Sold ] ),
    CALCULATE (
        SUM ( 'Fruit Sample Data Set'[ Units Sold ] ),
        ALL ( 'Fruit Sample Data Set'[Fruit] )
    )
)

r3.PNG

 

Regard

THANK YOU @v-ljerr-msft !!! This DAX is exactly what I've been searching the internet for. Very much appreciated!

Proposed solution doesn't works for me. I still get the % of Grand Total as a result

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.