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
alvin199
Helper III
Helper III

Question on Calculate Percentage

I have a sample data like this in table called Worker.

Percentage.png

 

I would like to create a DAX to calculate percentage of people in each station and then plot it into a bar chart.

The DAX I am using is 

Percentage of people =

CALCULATE(
                    COUNTROWs('Worker'),
                    ALL(
                           'Worker'['Station']
                           )
)/
COUNTROWS('Worker')
 
When I drag the Percentage of people measure to the line chart with Station on the X-axis, it will display the percentage over 100% in each bar. What is the mistake on my DAX?
1 ACCEPTED SOLUTION
PijushRoy
Super User
Super User

Hi @alvin199 

Please try this

Column = CALCULATE(
COUNT('Table'[Station]),ALL('Table'[Station]))/COUNT('Table'[Station])
Calculate % not greater than 100% DAXCalculate % not greater than 100% DAX

If you have any question, please let me know.
If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos



Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





View solution in original post

1 REPLY 1
PijushRoy
Super User
Super User

Hi @alvin199 

Please try this

Column = CALCULATE(
COUNT('Table'[Station]),ALL('Table'[Station]))/COUNT('Table'[Station])
Calculate % not greater than 100% DAXCalculate % not greater than 100% DAX

If you have any question, please let me know.
If solve your requirement, please mark this answer as SOLUTION
If this comment helps you, please LIKE this comment/Kudos



Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 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.