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

Helper I

## Why does this measure work?

Hi all,

I have a measure to calculate the percentage of two other measures, and it does work, I just don't know why it works.

On Time = 149

Past Due = 1

I want the % of past due, so on a calculator I divide 149 by 1 and multiply x 100 and I get 0.67 which is great.  If I do that in DAX, I get 0.01, which isn't great.  That is just using a measure called Total = [past due] / [on time].  I'm just replicating what I do on a calculator and it doesn't work.

Now if I do this measure, I get the correct number - 0.67.

Total = [past due] / ([on time] + [past due]).  I don't know why this works.  Any ideas?

2 ACCEPTED SOLUTIONS
Community Champion

Hi @randyrettig  - your measure should be as below:

%measure = DIVIDE([past due],([on time] + [past due]))

This divides the past due count by the total count (on time + past due).

I tested with sample i got it 0.01 after that you have to multiple with 100 . When you format this as a percentage, it becomes 0.67%, which matches your expected result

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Super User

Hi @randyrettig ,

Not sure if I got the essence of your error but looking at the measures you present both of them present the same value that is 0.01 (if rounded to 2 decimals) but be aware that since your values are very smal the measure look the same but they are not:

1/ 149 = 0.006711409

1 / (149 + 1) = 0.0066666

Believe that your problem is the lack of formatting has percentage this will give you the multiplication by 100 without writing it on the formula.

Regards

Miguel Félix

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português

2 REPLIES 2
Super User

Hi @randyrettig ,

Not sure if I got the essence of your error but looking at the measures you present both of them present the same value that is 0.01 (if rounded to 2 decimals) but be aware that since your values are very smal the measure look the same but they are not:

1/ 149 = 0.006711409

1 / (149 + 1) = 0.0066666

Believe that your problem is the lack of formatting has percentage this will give you the multiplication by 100 without writing it on the formula.

Regards

Miguel Félix

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português

Community Champion

Hi @randyrettig  - your measure should be as below:

%measure = DIVIDE([past due],([on time] + [past due]))

This divides the past due count by the total count (on time + past due).

I tested with sample i got it 0.01 after that you have to multiple with 100 . When you format this as a percentage, it becomes 0.67%, which matches your expected result

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

## Helpful resources

Announcements

#### Power BI Monthly Update - July 2024

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

#### Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors