Maximum of two numbers in a custom column

hyperchondriac

New Member
Joined
Jun 25, 2017
Messages
13
Hi all, trying to graduate from Excel to Power Query/Power BI. Perhaps my brain is not in the right gear yet.

I have a data set with a column of values. I have also added a literal column with a target value in each row. I would then like another custom column that is either the difference between the value and the target, if the value is greater than the target, or 0 if not. Basically MAX(A-B,0).

I don't seem to be able to find a formula that does this. Is this not how Power BI works?

HC
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi Matt,

Thanks for the reply. I have had a look at your article, and at some articles on Measures. But I'm not sure I get how this can be applied to my problem.

Here is what I need to do: I have a list of values that have been taken over a period of time. I want to display a graph of these values, in descending order, showing each value and the underperformance against the target. Here is a basic example of what I'd like to achieve (from my Excel comfort zone). The blue area is actual, and the orange is underperformance vs target.

11wgex2.jpg

In Excel I calculated MAX(Target-Value,0) for each row and plotted a stacked area graph. How do I get a similar outcome in Power BI?

HC
 
Upvote 0

Forum statistics

Threads
1,215,044
Messages
6,122,827
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top