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

Help with dividing values

Hi! 

 

I need help with dividing two values to create a new measure. This measure should show the sum of X divided by Y. However, after creating such a measure, the output is a bit off. My two values are 19 and 26, and when I divide those two values Power BI gives me 79.2%, but this is not correct as 19 / 26 = 73.1%. 

 

The DAX expression I have created in order to give the faulty output is: 

CALCULATE(COUNTROWS(Tablename1)/sum(Tablename2[columnname]))
 
Hopefully you can help as I do not see what I am doing wrong but still getting the faulty output.
 
Thanks!
4 REPLIES 4
v-deddai1-msft
Community Support
Community Support

Hi @Anonymous ,

 

It'e better that you can show us some sample data (sample pbix file ) by onedrive for business for referenece. Then we can can help you well.

 

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

 

Best Regards,

Dedmon Dai

amitchandak
Super User
Super User

@Anonymous , Try like , see if that give better result. Also change decimal place to 2 and check

CALCULATE(divide(COUNTROWS(Tablename1)*1.0,sum(Tablename2[columnname])))

Anonymous
Not applicable

Hi again, 

 

So the measure is correct however when I apply filters (such as date) this is when the output becomes wrong. The standard deviation also increases the lower the values I wish to divide. So for instance 2 / 3 is more faulty than 200 / 300 .

Anonymous
Not applicable

Hi, 

 

Thank you for answering but it still gives me the same faulty output, same number.. Not really sure why it does not show the correct value

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.