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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
amolkulkarnigk1
New Member

Unpivot table w

I have a table as below

 

Wrong Rate

Sr. No  Name  Appl. No  PolicyRate 

1          Abc     1234         10

2          zxc      1224         11

Need one additional column which shows values from 1st header i. e as "Wrong Rate" In each row of table

 

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

Hi @amolkulkarnigk1 ,

Based on the description, I'm assuming your table looks like this:

vcgaomsft_0-1703493628245.png

You can get the value of Wrong Rate by adding a custom column(After the twice Promoted Headers):

vcgaomsft_1-1703493845978.png

Advanced editor.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtAzMlLSUYKiWJ1opeAiPQW/fCDPLzE3FUg5FhTkQEUC8nMykyuDEktSwSoNQbJJyUDS0MjYBEQZgMVBBlZVQMSNwOKGSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Promoted Headers1" = Table.PromoteHeaders(#"Promoted Headers", [PromoteAllScalars=true]),
    #"Added Custom" = Table.AddColumn(#"Promoted Headers1", "Wrong Rate", each Source[Column1]{0})
in
    #"Added Custom"

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

View solution in original post

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @amolkulkarnigk1 ,

Based on the description, I'm assuming your table looks like this:

vcgaomsft_0-1703493628245.png

You can get the value of Wrong Rate by adding a custom column(After the twice Promoted Headers):

vcgaomsft_1-1703493845978.png

Advanced editor.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtAzMlLSUYKiWJ1opeAiPQW/fCDPLzE3FUg5FhTkQEUC8nMykyuDEktSwSoNQbJJyUDS0MjYBEQZgMVBBlZVQMSNwOKGSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
    #"Promoted Headers1" = Table.PromoteHeaders(#"Promoted Headers", [PromoteAllScalars=true]),
    #"Added Custom" = Table.AddColumn(#"Promoted Headers1", "Wrong Rate", each Source[Column1]{0})
in
    #"Added Custom"

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum -- China Power BI User Group

PijushRoy
Super User
Super User

Hi @amolkulkarnigk1 

I am not clear with your requirement, if the below solution is not working, please share more details and a screenshot of the requirement.


Try this, Create a Custom Column in Power Query
Give column name
In formula box, type

="Wrong Rate"

It will create a new column with the Wrong Rate text

 
If solved your requirement, please mark this answer as SOLUTION.
If this comment helps you, appreciate your KUDOS

Thanks 
Pijush

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors