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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
srpeters
Helper II
Helper II

Calculate percentage of a range compared to all entries

Hello,

 

I have a column filled with the ages of everyone in the table. How would I use DAX to calculate the percentage of people within the age range of 20 to 35? Is DAX capable of this or would I have to use the power query? 

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @srpeters ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1706507861106.png

(2) We can create a measure. 

Measure =
DIVIDE (
    CALCULATE ( COUNT ( 'Table'[age] ), 'Table'[age] <= 35 && 'Table'[age] >= 20 ),
    COUNTROWS ( ALL ( 'Table' ) ),
    0
)

(3) Then the result is as follows.

vtangjiemsft_1-1706507993670.png

Best Regards,

Neeko Tang

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
Anonymous
Not applicable

Hi @srpeters ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1706507861106.png

(2) We can create a measure. 

Measure =
DIVIDE (
    CALCULATE ( COUNT ( 'Table'[age] ), 'Table'[age] <= 35 && 'Table'[age] >= 20 ),
    COUNTROWS ( ALL ( 'Table' ) ),
    0
)

(3) Then the result is as follows.

vtangjiemsft_1-1706507993670.png

Best Regards,

Neeko Tang

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

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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