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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ygangadhara
New Member

Formulas two apply on Row Level

 

I'm hoping I can get a bit of help. I have data in two Rows need to calculate 3 rd row as mentioned below.

 

Value 1 & Value 2 are given 

Need to calculate Value3 = Value2/ Value1*100 for all the months

 

 JanFeb
VALUE11012
VALUE223
VALUE32025

 

 

Any help would be greatly apprecaited. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ygangadhara ,

I have created a simple smaple, please refer to it.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCnP0CXU1VNJRMjQAEUZKsTpQQSMgH4SNlWJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [value = _t, Jan = _t, Feb = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"value", type text}, {"Jan", Int64.Type}, {"Feb", Int64.Type}}),
    #"Demoted Headers" = Table.DemoteHeaders(#"Changed Type"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Demoted Headers",{{"Column1", type text}, {"Column2", type any}, {"Column3", type any}}),
    #"Transposed Table" = Table.Transpose(#"Changed Type1"),
    #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
    #"Changed Type2" = Table.TransformColumnTypes(#"Promoted Headers",{{"value", type text}, {"VALUE1", Int64.Type}, {"VALUE2", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type2", "Custom", each ([VALUE2]/[VALUE1])*100),
    #"Renamed Columns" = Table.RenameColumns(#"Added Custom",{{"Custom", "value 3"}}),
    #"Demoted Headers1" = Table.DemoteHeaders(#"Renamed Columns"),
    #"Changed Type3" = Table.TransformColumnTypes(#"Demoted Headers1",{{"Column1", type text}, {"Column2", type any}, {"Column3", type any}, {"Column4", type any}}),
    #"Transposed Table1" = Table.Transpose(#"Changed Type3"),
    #"Promoted Headers1" = Table.PromoteHeaders(#"Transposed Table1", [PromoteAllScalars=true]),
    #"Changed Type4" = Table.TransformColumnTypes(#"Promoted Headers1",{{"value", type text}, {"Jan", Int64.Type}, {"Feb", Int64.Type}})
in
    #"Changed Type4"

vpollymsft_0-1678761375927.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

1 REPLY 1
Anonymous
Not applicable

Hi @ygangadhara ,

I have created a simple smaple, please refer to it.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCnP0CXU1VNJRMjQAEUZKsTpQQSMgH4SNlWJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [value = _t, Jan = _t, Feb = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"value", type text}, {"Jan", Int64.Type}, {"Feb", Int64.Type}}),
    #"Demoted Headers" = Table.DemoteHeaders(#"Changed Type"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Demoted Headers",{{"Column1", type text}, {"Column2", type any}, {"Column3", type any}}),
    #"Transposed Table" = Table.Transpose(#"Changed Type1"),
    #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
    #"Changed Type2" = Table.TransformColumnTypes(#"Promoted Headers",{{"value", type text}, {"VALUE1", Int64.Type}, {"VALUE2", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type2", "Custom", each ([VALUE2]/[VALUE1])*100),
    #"Renamed Columns" = Table.RenameColumns(#"Added Custom",{{"Custom", "value 3"}}),
    #"Demoted Headers1" = Table.DemoteHeaders(#"Renamed Columns"),
    #"Changed Type3" = Table.TransformColumnTypes(#"Demoted Headers1",{{"Column1", type text}, {"Column2", type any}, {"Column3", type any}, {"Column4", type any}}),
    #"Transposed Table1" = Table.Transpose(#"Changed Type3"),
    #"Promoted Headers1" = Table.PromoteHeaders(#"Transposed Table1", [PromoteAllScalars=true]),
    #"Changed Type4" = Table.TransformColumnTypes(#"Promoted Headers1",{{"value", type text}, {"Jan", Int64.Type}, {"Feb", Int64.Type}})
in
    #"Changed Type4"

vpollymsft_0-1678761375927.png

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.