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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
JaseC1
New Member

Percentage based on Total of Column Series Values

I am trying to work out what measure I need to show the percentage of each column series value grouped by month.

The X axis is the date and I am using column series to split the case origin.

 

JaseC1_0-1644258092027.png

I plan to put the measure in a tooltip which would show:

  • October 1.8/2.6K (69.2%) for light blue and 0.8K/2.6K (30.8%) for dark blue.
  • Novembe 2.0/2.9K (69.0%)  for light blue and 0.9K/2.9K (31.0%) for dark blue.

 

I have a table called 'Case', the date column is 'Case'[CreatedDate] and split into series 'Case'[Origin]

 

 

 

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @JaseC1 ,

 

You can try the following code:

% =
DIVIDE(
    SUM( 'Table'[Values] ),
    CALCULATE( SUM( 'Table'[Values] ), ALLSELECTED( 'Table'[Type] ) )
)

Result:

vchenwuzmsft_0-1644483726153.png

Best Regards

Community Support Team _ chenwu zhu

 

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

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @JaseC1 ,

 

You can try the following code:

% =
DIVIDE(
    SUM( 'Table'[Values] ),
    CALCULATE( SUM( 'Table'[Values] ), ALLSELECTED( 'Table'[Type] ) )
)

Result:

vchenwuzmsft_0-1644483726153.png

Best Regards

Community Support Team _ chenwu zhu

 

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

TheoC
Super User
Super User

Hi @JaseC1 

 

When you drag the field/column across on to the visual pane, do you have the ability to click the little down arrow and select Show Value As? If so, you may be able to achieve what you're after without code/measure. 

 

Otherwise you can create the below three measures:

 

Total Sales = SUM ( Table[Amount] )

Total by Cat = CALCULATE ( [Total Sales] , ALL ( Table[Category] )

As Percent = DIVIDE ( [Total Sales] , [Total by Cat] , 0 )

 

Hopefully the above makes sense and apologies for syntax errors - on phone.

 

All the best,

Theo

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors