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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
CMOLINA
Frequent Visitor

Calculate Value to GAP Price

Hi team, I need your help to calculate "GAP PRICE", this is divide the Price Value of one column value between the another value from same column 

  • A column has 2 values: "Company 1" and "Company 2" 
  • Each Product has an Unit Price in each Company
  • GAP_Price Product 1 = Unit Price (product 1 in Company 1) / Unit Price (product 1 in Company 2) 

CMOLINA_0-1729212823769.png

 

1 ACCEPTED SOLUTION

Hi All

 

this is the solution I found:

 

CMOLINA_0-1729479660229.png

 

thanks for your help

 

View solution in original post

4 REPLIES 4
MFelix
Super User
Super User

Hi @CMOLINA ,

 

This can be calculated forcing the filter context of the company level, my question is only if company 1 and company 2 are always the same or if they can change.

 

You can try something similar to this:

Price GAP = DIVIDE( SUM(Table[UnitPrice]), CALCULATE(SUM(Table[UnitPrice]), Table[Company] = "Company2"))

 

Be aware that as you can see I'm forcing the filter on the second one to be Company 2 so not dinamic and in the second column you highlight this would give 100% since you would be divinding the number by itself, but is possible to make it dinamic but you need to tell me how you want to have the companies selection.


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





Hi @MFelix thanks for your answer

1. The name is always the same 🙂

2. I tried your suggestion but the value in column "Company 1" doesn't show 

CMOLINA_0-1729272556936.png

 

Anonymous
Not applicable

Hi ALL,
Firstly  MFelix thank you for your solution!
And @CMOLINA ,When running in our example data, we can see that company1 can have a value in this place.

vxingshenmsft_0-1729475715092.png

If your Column 1 is not displaying normal values, it is possible that the metric is not displaying the values correctly under Company 1, as in my example below, which could cause an error in your Column 1.

vxingshenmsft_1-1729476011010.png

Maybe I can't fully reproduce your problem due to my example data is too simple, may need to provide some example data or pbix file, we can better help you to solve this problem, if you still have further questions, you can contact us at any time, we will be the first time to reply to you after we receive your message, looking forward to your reply!

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

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

 

 

 

Hi All

 

this is the solution I found:

 

CMOLINA_0-1729479660229.png

 

thanks for your help

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.