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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Subtract specific value from each row of a column

Hello community. My problem is the follow:

F total / y total = 4.5151.

I would like to substract the above value (4.5151) from each row of w column an create a new column from the results (The w column is the result of F / y columns). For instance

4.5151 - 3.38 = 1.1351, 4.51.51 - 4.5 = 0.0151. In excel is very easy but I can't do it on PowerBI.

Please also have in your mind that I have filter the hour column to have specific hours and also I have a sclicer to select date and month.

Can you help me please?

 

test.PNG

1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Create a Calculated Column

 

Cc = 
var a = SUM('Table'[F])
var b = SUM('Table'[y])
var div = DIVIDE(a,b)
RETURN
div - 'Table'[w] 

 

 

1.jpg

 

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

3 REPLIES 3
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Create a Calculated Column

 

Cc = 
var a = SUM('Table'[F])
var b = SUM('Table'[y])
var div = DIVIDE(a,b)
RETURN
div - 'Table'[w] 

 

 

1.jpg

 

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Fowmy
Super User
Super User

@Anonymous 

Add these two measures:

W Column:

w = 
VAR L = DIVIDE(
    SUM([F]),
    SUM([Y])
)

VAR FTOTAL = CALCULATE(SUM([F]),ALLSELECTED('DATA'))
VAR YTOTAL = CALCULATE(SUM([Y]),ALLSELECTED('DATA'))
VAR GTOTAL = DIVIDE(FTOTAL,YTOTAL)
RETURN
IF(
    HASONEVALUE('DATA'[F]),
    L,
    DIVIDE(
        FTOTAL,
        YTOTAL
    )


New Column Measure:

New Column = 
VAR FTOTAL = CALCULATE(SUM([F]),ALLSELECTED('DATA'))
VAR YTOTAL = CALCULATE(SUM([Y]),ALLSELECTED('DATA'))
VAR GTOTAL = DIVIDE(FTOTAL,YTOTAL)
RETURN
IF(
    HASONEVALUE('DATA'[F]),
    [w] - GTOTAL
    ,
    BLANK()
)

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn







 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

amitchandak
Super User
Super User

@Anonymous , Try like

calculate(divide(sum(Table[F]),Sum(Table[y])), all(Table)) - divide(sum(Table[F]),Sum(Table[y]))

or

calculate(divide(sum(Table[F]),Sum(Table[y])), allselected(Table)) - divide(sum(Table[F]),Sum(Table[y]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors