Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi Friends,
Is there a subtraction formula?
I cannot find on the internet or power bi forum.
Which is quite tough to achieve the result i wanted.
Kindly assist me guys.
Solved! Go to Solution.
Hi @rainchong7401 ,
Are you the maximum value minus all other values or from top to bottom, the last row of values minus all the values above?
In the first case, create a measure like this:
Subtract Formula = var _max=CALCULATE(MAX('Table'[Number]),ALLSELECTED('Table'))
var _total=_max*2-CALCULATE(SUM('Table'[Number]),ALLSELECTED('Table'))
return IF(ISINSCOPE('Table'[Number]),SUM('Table'[Number]),_total)
In the second case, you need to create an index column to get the value of the last row and subtract the other values.
Add the index column in Power Query.
Then create a measure.
Subtract Formula 2 = var _maxindex=CALCULATE(MAX('Table'[Index]),ALLSELECTED('Table'))
var _last=CALCULATE(SUM('Table'[Number]),FILTER(ALLSELECTED('Table'),[Index]=_maxindex))
return IF(ISINSCOPE('Table'[Number]),SUM('Table'[Number]),_last*2-CALCULATE(SUM('Table'[Number]),ALLSELECTED('Table')))
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @rainchong7401 ,
Are you the maximum value minus all other values or from top to bottom, the last row of values minus all the values above?
In the first case, create a measure like this:
Subtract Formula = var _max=CALCULATE(MAX('Table'[Number]),ALLSELECTED('Table'))
var _total=_max*2-CALCULATE(SUM('Table'[Number]),ALLSELECTED('Table'))
return IF(ISINSCOPE('Table'[Number]),SUM('Table'[Number]),_total)
In the second case, you need to create an index column to get the value of the last row and subtract the other values.
Add the index column in Power Query.
Then create a measure.
Subtract Formula 2 = var _maxindex=CALCULATE(MAX('Table'[Index]),ALLSELECTED('Table'))
var _last=CALCULATE(SUM('Table'[Number]),FILTER(ALLSELECTED('Table'),[Index]=_maxindex))
return IF(ISINSCOPE('Table'[Number]),SUM('Table'[Number]),_last*2-CALCULATE(SUM('Table'[Number]),ALLSELECTED('Table')))
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
How do you get 34?
I got you can add up to 66
Regards,
Ritesh
Please give a clear explanation.
Sub is not a big deal Power BI Measure Sum and Subtract Example - SPGuides
Thanks,
Ritesh
Hi Ritesh,
Sum([column]) = 66
What if I want to have subtraction? (Is there a =Sub() formula)
Sub([column]) = 34
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 45 | |
| 38 | |
| 34 | |
| 21 | |
| 17 |
| User | Count |
|---|---|
| 66 | |
| 64 | |
| 31 | |
| 26 | |
| 26 |