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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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.


Go to My LinkedIn Page


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.


Go to My LinkedIn Page


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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