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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
sdhn
Responsive Resident
Responsive Resident

Creating new calculated columns

Hi All,

 

I have source file as below:

 

sdhn_2-1639587882170.png

 

I want to create thru Power Bi as:

sdhn_3-1639588199215.png

 

Columns with Excel formulas:

1)

 

"Total 1"

=(B2+C2)

 

2)

"P %"

=IF(D2<=0,"N/A",(C2/D2))

 

 3)

"Total Amount"

=IF(D2>0,SUM(F2:G2),0)

 

 4)

"Average"

=IF(H2>0,(H2/D2),"N/A")

 

I want to use Power Bi dashboard to calculate & create above columns "Total 1" , "P %", "Total Amount", "Average" .   

 

Help will be apprcecaited.  Thanks 

 

 

 

 

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @sdhn ,

According to your description, here's my solution.

"Total 1" , "P %", "Total Amount", "Average" are all calculated columns.

Total1 = 'Table'[Col1]+'Table'[Col2]
P% =
IF (
    'Table'[Total1] <= 0,
    "N/A",
    FORMAT ( DIVIDE ( 'Table'[Col2], 'Table'[Total1] ), "0.0%" )
)
Total Amount = 'Table'[Col3]+'Table'[Col4]
Average =
IF (
    'Table'[Total Amount] > 0,
    FORMAT ( DIVIDE ( 'Table'[Total Amount], 'Table'[Total1] ), "0.000" ),
    "N/A"
)

Get the expected result.

vkalyjmsft_0-1640067021476.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

 

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

View solution in original post

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @sdhn ,

According to your description, here's my solution.

"Total 1" , "P %", "Total Amount", "Average" are all calculated columns.

Total1 = 'Table'[Col1]+'Table'[Col2]
P% =
IF (
    'Table'[Total1] <= 0,
    "N/A",
    FORMAT ( DIVIDE ( 'Table'[Col2], 'Table'[Total1] ), "0.0%" )
)
Total Amount = 'Table'[Col3]+'Table'[Col4]
Average =
IF (
    'Table'[Total Amount] > 0,
    FORMAT ( DIVIDE ( 'Table'[Total Amount], 'Table'[Total1] ), "0.000" ),
    "N/A"
)

Get the expected result.

vkalyjmsft_0-1640067021476.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

 

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

amitchandak
Super User
Super User

@sdhn , try new columns like

 

1)

 

"Total 1"

=([Col1]+[Col2])

 

a Measure = sum([Col1]) + Sum([Col2])

 

2)

"P %"

=divide([Col2], [Total])

 

measure =  =divide(sum([Col2]), Sum(Table[Total]) ) //if total is column

3)

"Total Amount"

= [Col3] + [Col4]

 

measure = sum([Col3]) + sum([Col4])

4)

"Average"

=divide([Total Amount], [Total])

 

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
sdhn
Responsive Resident
Responsive Resident

2)

"P %"

=divide([Col2], [Total])

 

measure =  =divide(sum([Col2]), Sum(Table[Total]) ) //if total is column

 

Total is a measure not a column

 

SUM(B43:C43)

 

sdhn
Responsive Resident
Responsive Resident

REF

 

2)

measure =  =divide(sum([Col2]), Sum(Table[Total]) ) //if total is column

 

Total is a measure created in 1. How measure can add above?

 

1) 

a Measure = sum([Col1]) + Sum([Col2])

 

My code status

measure =  =divide(sum([Col1]) + Sum(.........   measure is not listed 

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.