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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply

How to create a measure to calculate something like this (A-B)/A in each row

Hi,

good day.

 

I have a table called POs, and there are two columns; one for PR price and another for PO price and I want to get the following:

1-( PR -PO )/PR

2- The Average of that.

3- how many row was "the result in 1" greater than 20%

 

can you help.

Best Regards.

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @freevission2019 

Please correct me if I wrongly understood your question.

If you are looking for something like below,

please check the below link, which is the sample pbix file.

Otherwise, if it is OK with you, please share your sample data file, then I can look into it to come up with more accurate measures.

 

Picture2.png

 

average of that =
AVERAGEX( 'Table', DIVIDE('Table'[PR Price] - 'Table'[PO Price], 'Table'[PR Price]))
 
countrows greater than 20% =
COUNTROWS( FILTER('Table', [average of that] >0.2))
 
 

Jihwan Kim

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

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

2 REPLIES 2

Thank you very much Jihwan. 

perfect😊 👌

Jihwan_Kim
Super User
Super User

Hi, @freevission2019 

Please correct me if I wrongly understood your question.

If you are looking for something like below,

please check the below link, which is the sample pbix file.

Otherwise, if it is OK with you, please share your sample data file, then I can look into it to come up with more accurate measures.

 

Picture2.png

 

average of that =
AVERAGEX( 'Table', DIVIDE('Table'[PR Price] - 'Table'[PO Price], 'Table'[PR Price]))
 
countrows greater than 20% =
COUNTROWS( FILTER('Table', [average of that] >0.2))
 
 

Jihwan Kim

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

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.